summaryrefslogtreecommitdiff
path: root/shell.c
diff options
context:
space:
mode:
authorDima Sharov <git.avalakvista@gmail.com>2011-05-05 06:40:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-05-05 16:32:28 (GMT)
commit2d9932cf67a886c8f356603b9ffd81832cc1850f (patch)
treea54b3861e7c99e8814e530888c843ef74a5b09fc /shell.c
parent2f312e8851035a85f431911075383265f1519c04 (diff)
downloadgit-2d9932cf67a886c8f356603b9ffd81832cc1850f.zip
git-2d9932cf67a886c8f356603b9ffd81832cc1850f.tar.gz
git-2d9932cf67a886c8f356603b9ffd81832cc1850f.tar.bz2
shell: add missing initialization of argv0_path
According to c6dfb39 (remote-curl: add missing initialization of argv0_path, 2009-10-13), stand-alone programs (non-builtins) must call git_extract_argv0_path(argv[0]) in order to help builds that derive the installation prefix at runtime. Without this call, the program segfaults (or raises an assertion failure). Signed-off-by: Dima Sharov <git.avalakvista@gmail.com> Acked-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'shell.c')
-rw-r--r--shell.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/shell.c b/shell.c
index dea4cfd..abb8622 100644
--- a/shell.c
+++ b/shell.c
@@ -137,6 +137,8 @@ int main(int argc, char **argv)
int devnull_fd;
int count;
+ git_extract_argv0_path(argv[0]);
+
/*
* Always open file descriptors 0/1/2 to avoid clobbering files
* in die(). It also avoids not messing up when the pipes are