From 7fb1011e610a28518959b1d2d48cea17ecc32048 Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Thu, 20 Sep 2007 00:42:14 +0200 Subject: 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 --- quote.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'quote.h') diff --git a/quote.h b/quote.h index 8a59cc55d1..f48a3fc584 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); -- cgit v1.2.1