[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>
This commit is contained in:
Linus Torvalds 2005-08-23 17:14:13 -07:00 committed by Junio C Hamano
parent ab22707f0a
commit 569061432e

View File

@ -496,7 +496,7 @@ static void verify_pathspec(void)
char c = n[i]; char c = n[i];
if (prev && prev[i] != c) if (prev && prev[i] != c)
break; break;
if (c == '*' || c == '?') if (!c || c == '*' || c == '?')
break; break;
if (c == '/') if (c == '/')
len = i+1; len = i+1;