mirror of
https://github.com/git/git.git
synced 2026-03-31 03:50:10 +02:00
Fix unchecked chdir() return value
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
@@ -576,8 +576,9 @@ static void run_pager(struct grep_opt *opt, const char *prefix)
|
||||
argv[i] = path_list->items[i].string;
|
||||
argv[path_list->nr] = NULL;
|
||||
|
||||
if (prefix)
|
||||
chdir(prefix);
|
||||
if (prefix && chdir(prefix))
|
||||
die("Could not chdir(%s)", prefix);
|
||||
|
||||
execvp(argv[0], argv);
|
||||
error("Could not run pager %s: %s", argv[0], strerror(errno));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user