diff options
author | Larry D'Anna <larry@elder-gods.org> | 2010-02-15 23:10:45 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-02-15 21:46:01 -0800 |
commit | 8324b977aef3d2301f170e23f498b50e11302575 (patch) | |
tree | c8a923851921f2f2efd50094deb9235afa966e8a /diff.c | |
parent | 33f0ea42e12d3f54ef8ff53580649885c1503d05 (diff) | |
download | git-8324b977aef3d2301f170e23f498b50e11302575.tar.gz |
diff: make sure --output=/bad/path is caught
The return value from fopen wasn't being checked.
Signed-off-by: Larry D'Anna <larry@elder-gods.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.c')
-rw-r--r-- | diff.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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; |