author | Ben Walton <bwalton@artsci.utoronto.ca> | |
Fri, 9 Oct 2009 01:53:35 +0000 (21:53 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 9 Oct 2009 05:54:34 +0000 (22:54 -0700) | ||
commit | ac78b009398f8cab1f57d1ef62db21ac95e11ed1 | |
tree | ffe4e8a4f97c188af1cc682465f29ff45e33e62b | tree | snapshot |
parent | 1cd749cc0722533bd1849f491ec9ab19e17232e1 | commit | diff |
ls-files: die instead of fprintf/exit in -i error
When ls-files was called with -i but no exclude pattern, it was
calling fprintf(stderr, "...", NULL) and then exiting. On Solaris,
passing NULL into fprintf was causing a segfault. On glibc systems,
it was simply producing incorrect output (eg: "(null)": ...). The
NULL pointer was a result of argv[0] not being preserved by the option
parser. Instead of requesting that the option parser preserve
argv[0], use die() with a constant string.
A trigger for this bug was: `git ls-files -i`
Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
When ls-files was called with -i but no exclude pattern, it was
calling fprintf(stderr, "...", NULL) and then exiting. On Solaris,
passing NULL into fprintf was causing a segfault. On glibc systems,
it was simply producing incorrect output (eg: "(null)": ...). The
NULL pointer was a result of argv[0] not being preserved by the option
parser. Instead of requesting that the option parser preserve
argv[0], use die() with a constant string.
A trigger for this bug was: `git ls-files -i`
Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-ls-files.c | diff | blob | history |