diff options
Diffstat (limited to 'common-main.c')
-rw-r--r-- | common-main.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/common-main.c b/common-main.c index eafc70718a..29fb7452f8 100644 --- a/common-main.c +++ b/common-main.c @@ -26,6 +26,7 @@ static void restore_sigpipe_to_default(void) int main(int argc, const char **argv) { int result; + struct strbuf tmp = STRBUF_INIT; trace2_initialize_clock(); @@ -49,6 +50,9 @@ int main(int argc, const char **argv) trace2_cmd_start(argv); trace2_collect_process_info(TRACE2_PROCESS_INFO_STARTUP); + if (!strbuf_getcwd(&tmp)) + tmp_original_cwd = strbuf_detach(&tmp, NULL); + result = cmd_main(argc, argv); /* |