mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
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 <madcoder@debian.org>
This commit is contained in:
committed by
Junio C Hamano
parent
c76689df6c
commit
7fb1011e61
2
quote.h
2
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);
|
||||
|
||||
Reference in New Issue
Block a user