]> asedeno.scripts.mit.edu Git - git.git/blobdiff - quote.c
Documentation: ls-files -v is about "assume unchanged".
[git.git] / quote.c
diff --git a/quote.c b/quote.c
index 919d0920abfc0bd2becbcc35fd065514b9651281..6986b4420f66e1f01cd4517d35ce9adc300eaa8b 100644 (file)
--- a/quote.c
+++ b/quote.c
@@ -56,20 +56,13 @@ void sq_quote_print(FILE *stream, const char *src)
        fputc('\'', stream);
 }
 
-void sq_quote_argv(struct strbuf *dst, const char** argv, int count,
-                   size_t maxlen)
+void sq_quote_argv(struct strbuf *dst, const char** argv, size_t maxlen)
 {
        int i;
 
-       /* Count argv if needed. */
-       if (count < 0) {
-               for (count = 0; argv[count]; count++)
-                       ; /* just counting */
-       }
-
        /* Copy into destination buffer. */
-       strbuf_grow(dst, 32 * count);
-       for (i = 0; i < count; ++i) {
+       strbuf_grow(dst, 255);
+       for (i = 0; argv[i]; ++i) {
                strbuf_addch(dst, ' ');
                sq_quote_buf(dst, argv[i]);
                if (maxlen && dst->len > maxlen)
@@ -131,7 +124,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;
 }