Skip to content

Commit

Permalink
diff: trivial fix for --output file error message
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Matthieu Moy authored and Junio C Hamano committed Sep 29, 2010
1 parent e1ba4c3 commit 9ec26eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -3310,7 +3310,7 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
else if ((argcount = parse_long_opt("output", av, &optarg))) {
options->file = fopen(optarg, "w");
if (!options->file)
die_errno("Could not open '%s'", arg + strlen("--output="));
die_errno("Could not open '%s'", optarg);
options->close_file = 1;
return argcount;
} else
Expand Down

0 comments on commit 9ec26eb

Please sign in to comment.