Code

git-svn: Fix a typo and add a comma in an error message in git-svn
[git.git] / quote.c
diff --git a/quote.c b/quote.c
index 800fd88c9ae9979bf44c91fea54c092cdafdb33c..04557833a561b4613a511af8fb9f0fb18b36b2fa 100644 (file)
--- a/quote.c
+++ b/quote.c
@@ -22,11 +22,11 @@ void sq_quote_buf(struct strbuf *dst, const char *src)
        char *to_free = NULL;
 
        if (dst->buf == src)
-               to_free = strbuf_detach(dst);
+               to_free = strbuf_detach(dst, NULL);
 
        strbuf_addch(dst, '\'');
        while (*src) {
-               size_t len = strcspn(src, "'\\");
+               size_t len = strcspn(src, "'!");
                strbuf_add(dst, src, len);
                src += len;
                while (need_bs_quote(*src)) {
@@ -131,7 +131,8 @@ static signed char const sq_lookup[256] = {
        /* 0x80 */ /* set to 0 */
 };
 
-static inline int sq_must_quote(char c) {
+static inline int sq_must_quote(char c)
+{
        return sq_lookup[(unsigned char)c] + quote_path_fully > 0;
 }