aboutsummaryrefslogtreecommitdiff
path: root/ls-files.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@osdl.org>2005-08-23 17:14:13 -0700
committerJunio C Hamano <junkio@cox.net>2005-08-24 18:53:29 -0700
commit569061432e3a695d5a4178d515971ddcc0a80709 (patch)
tree12a7a8c4b16c92ad1c845a958ba9b5e214a630a7 /ls-files.c
parentab22707f0a9480b2fe47d20030a03994f8e5d0b3 (diff)
downloadgit-569061432e3a695d5a4178d515971ddcc0a80709.tar.gz
git-569061432e3a695d5a4178d515971ddcc0a80709.tar.xz
[PATCH] Fix silly pathspec bug in git-ls-files
The "verify_pathspec()" function doesn't test for ending NUL character in the pathspec, causing some really funky and unexpected behaviour. It just happened to work in the cases I had tested. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'ls-files.c')
-rw-r--r--ls-files.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ls-files.c b/ls-files.c
index 2c7aada88..e53d24588 100644
--- a/ls-files.c
+++ b/ls-files.c
@@ -496,7 +496,7 @@ static void verify_pathspec(void)
char c = n[i];
if (prev && prev[i] != c)
break;
- if (c == '*' || c == '?')
+ if (!c || c == '*' || c == '?')
break;
if (c == '/')
len = i+1;