summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorKevin Ballard <kevin@sb.org>2008-08-13 22:34:34 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-08-14 00:11:03 (GMT)
commitea335b56d44a92b9b8be40b1465d7df65a4f736b (patch)
tree8fb43988263fce307dc046d5b4c1cb7d078d0a63 /dir.c
parent9612e74342cfd38c0b83230a2c847cd070599a5a (diff)
downloadgit-ea335b56d44a92b9b8be40b1465d7df65a4f736b.zip
git-ea335b56d44a92b9b8be40b1465d7df65a4f736b.tar.gz
git-ea335b56d44a92b9b8be40b1465d7df65a4f736b.tar.bz2
Fix escaping of glob special characters in pathspecs
match_one implements an optimized pathspec match where it only uses fnmatch if it detects glob special characters in the pattern. Unfortunately it didn't treat \ as a special character, so attempts to escape a glob special character would fail even though fnmatch() supports it. Signed-off-by: Kevin Ballard <kevin@sb.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dir.c b/dir.c
index 29d1d5b..109e05b 100644
--- a/dir.c
+++ b/dir.c
@@ -54,7 +54,7 @@ int common_prefix(const char **pathspec)
static inline int special_char(unsigned char c1)
{
- return !c1 || c1 == '*' || c1 == '[' || c1 == '?';
+ return !c1 || c1 == '*' || c1 == '[' || c1 == '?' || c1 == '\\';
}
/*