{"thread":{"id":"1632","subject":"Fix silly pathspec bug in git-ls-files","startedAt":"2005-08-24T00:14:13Z","lastAt":"2005-08-24T00:14:13Z","messageCount":1,"participants":["Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"7684","messageId":"Pine.LNX.4.58.0508231711350.3317@g5.osdl.org","threadId":"1632","inReplyTo":null,"subject":"Fix silly pathspec bug in git-ls-files","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-08-24T00:14:13Z","receivedAt":"2005-08-24T00:14:13Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\nThe \"verify_pathspec()\" function doesn't test for ending NUL character in \nthe pathspec, causing some really funky and unexpected behaviour. It just \nhappened to work in the cases I had tested.\n\nSigned-off-by: Linus Torvalds <torvalds@osdl.org>\n---\ndiff --git a/ls-files.c b/ls-files.c\n--- a/ls-files.c\n+++ b/ls-files.c\n@@ -496,7 +496,7 @@ static void verify_pathspec(void)\n \t\t\tchar c = n[i];\n \t\t\tif (prev && prev[i] != c)\n \t\t\t\tbreak;\n-\t\t\tif (c == '*' || c == '?')\n+\t\t\tif (!c || c == '*' || c == '?')\n \t\t\t\tbreak;\n \t\t\tif (c == '/')\n \t\t\t\tlen = i+1;\n"}]}