Merge branch 'maint-1.6.6' into maint
[gitweb.git] / diff.c
diff --git a/diff.c b/diff.c
index 381cc8d4fd69ca31fb8fc8af31422160e3ec1fd3..68def6caed876669d38f1baafc5a0cd6318ab16a 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -2893,6 +2893,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;