提交 8324b977 编写于 作者: L Larry D'Anna 提交者: Junio C Hamano

diff: make sure --output=/bad/path is caught

The return value from fopen wasn't being checked.
Signed-off-by: NLarry D'Anna <larry@elder-gods.org>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 33f0ea42
......@@ -2799,6 +2799,8 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
;
else if (!prefixcmp(arg, "--output=")) {
options->file = fopen(arg + strlen("--output="), "w");
if (!options->file)
die_errno("Could not open '%s'", arg + strlen("--output="));
options->close_file = 1;
} else
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册