Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryorah <yoram.harmelin@gmail.com>2012-07-12 18:31:59 +0400
committeryorah <yoram.harmelin@gmail.com>2012-07-24 16:03:07 +0400
commit02a0d651d79b2108dd6b894b9a43f7682270ac51 (patch)
treee90cbe5dccf69913f226799860a541ab31df29c3 /src/attr_file.c
parent944d250f964698b33d9fa09e2e6af74b1dd84de2 (diff)
Add git_buf_unescape and git__unescape to unescape all characters in a string (in-place)
Diffstat (limited to 'src/attr_file.c')
-rw-r--r--src/attr_file.c12
1 files changed, 1 insertions, 11 deletions
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;