From 02a0d651d79b2108dd6b894b9a43f7682270ac51 Mon Sep 17 00:00:00 2001 From: yorah Date: Thu, 12 Jul 2012 16:31:59 +0200 Subject: Add git_buf_unescape and git__unescape to unescape all characters in a string (in-place) --- src/attr_file.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'src/attr_file.c') diff --git a/src/attr_file.c b/src/attr_file.c index 0dad09727..837c42d8e 100644 --- a/src/attr_file.c +++ b/src/attr_file.c @@ -426,17 +426,7 @@ int git_attr_fnmatch__parse( return -1; } else { /* strip '\' that might have be used for internal whitespace */ - char *to = spec->pattern; - for (scan = spec->pattern; *scan; to++, scan++) { - if (*scan == '\\') - scan++; /* skip '\' but include next char */ - if (to != scan) - *to = *scan; - } - if (to != scan) { - *to = '\0'; - spec->length = (to - spec->pattern); - } + spec->length = git__unescape(spec->pattern); } return 0; -- cgit v1.2.3