Skip to content

Commit 2b43dd0

Browse files
rscharfegitster
authored andcommitted
diff-no-index: simplify argv index calculation
Since 16bb3d7 (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 07a6f94 commit 2b43dd0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

diff-no-index.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ int diff_no_index(struct rev_info *revs,
267267
}
268268
FREE_AND_NULL(options);
269269
for (i = 0; i < 2; i++) {
270-
const char *p = argv[argc - 2 + i];
270+
const char *p = argv[i];
271271
if (!strcmp(p, "-"))
272272
/*
273273
* stdin should be spelled as "-"; if you have

0 commit comments

Comments
 (0)