summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4dd47c3)
raw | patch | inline | side by side (parent: 4dd47c3)
author | Steffen Prohaska <prohaska@zib.de> | |
Sun, 18 Jan 2009 12:00:11 +0000 (13:00 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 26 Jan 2009 08:26:05 +0000 (00:26 -0800) |
This simplifies the calling code.
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
exec_cmd.c | patch | blob | history | |
git.c | patch | blob | history |
diff --git a/exec_cmd.c b/exec_cmd.c
index e508f1e66d92d46c00013691d5a7c1d7dc8fe11a..f8f416b6460d7d2d4f5415258dadc7367412ba5a 100644 (file)
--- a/exec_cmd.c
+++ b/exec_cmd.c
const char *git_extract_argv0_path(const char *argv0)
{
- const char *slash = argv0 + strlen(argv0);
+ const char *slash;
+
+ if (!argv0 || !*argv0)
+ return NULL;
+ slash = argv0 + strlen(argv0);
while (argv0 <= slash && !is_dir_sep(*slash))
slash--;