path: root/quote.h
diff options
authorPierre Habouzit <>2007-09-19 22:42:14 (GMT)
committerJunio C Hamano <>2007-09-21 06:32:18 (GMT)
commit7fb1011e610a28518959b1d2d48cea17ecc32048 (patch)
tree2f07cfdbd6e14dd3e98e1325c7f30c325ea4c785 /quote.h
parentc76689df6c64a1e987bd779bd71a2042b5131fb9 (diff)
Rework unquote_c_style to work on a strbuf.
If the gain is not obvious in the diffstat, the resulting code is more readable, _and_ in checkout-index/update-index we now reuse the same buffer to unquote strings instead of always freeing/mallocing. This also is more coherent with the next patch that reworks quoting functions. The quoting function is also made more efficient scanning for backslashes and treating portions of strings without a backslash at once. Signed-off-by: Pierre Habouzit <>
Diffstat (limited to 'quote.h')
1 files changed, 1 insertions, 1 deletions
diff --git a/quote.h b/quote.h
index 8a59cc5..f48a3fc 100644
--- a/quote.h
+++ b/quote.h
@@ -43,9 +43,9 @@ extern int add_to_string(char **ptrp, int *sizep, const char *str, int quote);
extern char *sq_dequote(char *);
+extern int unquote_c_style(struct strbuf *, const char *quoted, const char **endp);
extern int quote_c_style(const char *name, char *outbuf, FILE *outfp,
int nodq);
-extern char *unquote_c_style(const char *quoted, const char **endp);
extern void write_name_quoted(const char *prefix, int prefix_len,
const char *name, int quote, FILE *out);