From 2b43dd0eb5f3f035b9bd9d019ec405dd55ec15e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Wed, 7 Sep 2022 13:45:42 +0200 Subject: diff-no-index: simplify argv index calculation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since 16bb3d714d (diff --no-index: use parse_options() instead of diff_opt_parse(), 2019-03-24) argc must be 2 if we reach the loop, i.e. argc - 2 == 0. Remove that inconsequential term. Signed-off-by: René Scharfe Signed-off-by: Junio C Hamano --- diff-no-index.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'diff-no-index.c') diff --git a/diff-no-index.c b/diff-no-index.c index a18f6c3c63..18edbdf4b5 100644 --- a/diff-no-index.c +++ b/diff-no-index.c @@ -267,7 +267,7 @@ int diff_no_index(struct rev_info *revs, } FREE_AND_NULL(options); for (i = 0; i < 2; i++) { - const char *p = argv[argc - 2 + i]; + const char *p = argv[i]; if (!strcmp(p, "-")) /* * stdin should be spelled as "-"; if you have -- cgit v1.2.1