@matheusbsbs / matheus-bagliano / commits / 2d9932cf67
Fork 0

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>

Dima Sharov committed May 5, 2011 at 09:40 UTC 2d9932cf67a886c8f356603b9ffd81832cc1850f
1 file changed +2
shell.c
+2
@@ -137,6 +137,8 @@ int main(int argc, char **argv)
137 int devnull_fd;
138 int count;
139
140 + git_extract_argv0_path(argv[0]);
141 +
142 /*
143 * Always open file descriptors 0/1/2 to avoid clobbering files
144 * in die(). It also avoids not messing up when the pipes are