Skip to content

Commit 2d9932c

Browse files
Dima Sharovgitster
authored andcommitted
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 <[email protected]> Acked-by: Johannes Sixt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2f312e8 commit 2d9932c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

shell.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ int main(int argc, char **argv)
137137
int devnull_fd;
138138
int count;
139139

140+
git_extract_argv0_path(argv[0]);
141+
140142
/*
141143
* Always open file descriptors 0/1/2 to avoid clobbering files
142144
* in die(). It also avoids not messing up when the pipes are

0 commit comments

Comments
 (0)