git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Fix silly pathspec bug in git-ls-files
@ 2005-08-24  0:14 Linus Torvalds
  0 siblings, 0 replies; only message in thread
From: Linus Torvalds @ 2005-08-24  0:14 UTC (permalink / raw
  To: Junio C Hamano, Git Mailing List


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>
---
diff --git a/ls-files.c b/ls-files.c
--- 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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-08-24  0:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-24  0:14 Fix silly pathspec bug in git-ls-files Linus Torvalds

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).