From: Linus Torvalds Date: Wed, 24 Aug 2005 00:14:13 +0000 (-0700) Subject: [PATCH] Fix silly pathspec bug in git-ls-files X-Git-Tag: v0.99.5^2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=569061432e3a695d5a4178d515971ddcc0a80709;p=git.git [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 Signed-off-by: Junio C Hamano --- diff --git a/ls-files.c b/ls-files.c index 2c7aada8..e53d2458 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;