{"thread":{"id":"27230","subject":"[PATCH] shell: add missing initialization of argv0_path","startedAt":"2011-05-01T06:06:36Z","lastAt":"2011-05-01T06:06:36Z","messageCount":1,"participants":["Dima Sharov"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"166808","messageId":"8F1D5462-15DC-4F01-9F6A-5C0E477B12F6@gmail.com","threadId":"27230","inReplyTo":null,"subject":"[PATCH] shell: add missing initialization of argv0_path","fromName":"Dima Sharov","fromEmail":"git.avalakvista@gmail.com","sentAt":"2011-05-01T06:06:36Z","receivedAt":"2011-05-01T06:06:36Z","isPatch":true,"sender":{"key":"git.avalakvista@gmail.com","avatar":null},"body":"According to c6dfb39 (remote-curl: add missing initialization of\nargv0_path, 2009-10-13), stand-alone programs (non-builtins)\nmust call git_extract_argv0_path(argv[0]) in order to help builds\nthat derive the installation prefix at runtime. Without this call,\nthe program segfaults (or raises an assertion failure).\n\nSigned-off-by: Dima Sharov <git.avalakvista@gmail.com>\n---\n shell.c |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/shell.c b/shell.c\nindex dea4cfd..abb8622 100644\n--- a/shell.c\n+++ b/shell.c\n@@ -137,6 +137,8 @@ int main(int argc, char **argv)\n \tint devnull_fd;\n \tint count;\n \n+\tgit_extract_argv0_path(argv[0]);\n+\n \t/*\n \t * Always open file descriptors 0/1/2 to avoid clobbering files\n \t * in die().  It also avoids not messing up when the pipes are\n-- \n1.7.2.3\n"}]}