orig_cwd = xgetcwd();
for (i = 0; i < ARRAY_SIZE(env_names); i++) {
orig_env[i] = getenv(env_names[i]);
- if (orig_env[i])
- orig_env[i] = xstrdup(orig_env[i]);
+ orig_env[i] = xstrdup_or_null(orig_env[i]);
}
}
cmd = argv[0];
if (!cmd)
cmd = "git-help";
+ else {
+ const char *slash = find_last_dir_sep(cmd);
+ if (slash)
+ cmd = slash + 1;
+ }
trace_command_performance(argv);