diff options
author | Larry D'Anna <larry@elder-gods.org> | 2010-02-16 07:10:45 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-02-16 08:46:01 +0300 |
commit | 8324b977aef3d2301f170e23f498b50e11302575 (patch) | |
tree | c8a923851921f2f2efd50094deb9235afa966e8a | |
parent | 33f0ea42e12d3f54ef8ff53580649885c1503d05 (diff) |
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>
-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; |