From 9ec26eb7cd7767faffac9bac5e22ede0d25e20e3 Mon Sep 17 00:00:00 2001 From: Matthieu Moy Date: Wed, 29 Sep 2010 09:26:23 +0200 Subject: 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 Signed-off-by: Junio C Hamano --- diff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'diff.c') diff --git a/diff.c b/diff.c index 9a5c77c13f..0e2e872e0b 100644 --- a/diff.c +++ b/diff.c @@ -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 -- cgit v1.2.3