@matheusbsbs / matheus-bagliano / commits / 9ec26eb7cd
Fork 0

diff: trivial fix for --output file error message

The option argument is either after the equal sign in --output=... or in the next command-line argument. optarg is the reliable way to access it. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Matthieu Moy committed Sep 29, 2010 at 09:26 UTC 9ec26eb7cd7767faffac9bac5e22ede0d25e20e3
1 file changed +1 -1
diff.c
+1 -1
@@ -3310,7 +3310,7 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
3310 else if ((argcount = parse_long_opt("output", av, &optarg))) {
3311 options->file = fopen(optarg, "w");
3312 if (!options->file)
3313 - die_errno("Could not open '%s'", arg + strlen("--output="));
3313 + die_errno("Could not open '%s'", optarg);
3314 options->close_file = 1;
3315 return argcount;
3316 } else