Skip to content

Commit

Permalink
Remove unnecessary usage of strncmp() in git-rev-list arg parsing.
Browse files Browse the repository at this point in the history
Not only is it unnecessary, it incorrectly allows extraneous characters
at the end of the argument.

Junio noticed the --merge-order thing, and Jon points out that if we fix
that one, we should fix --show-breaks too.
  • Loading branch information
Linus Torvalds committed Jul 5, 2005
1 parent bbca20a commit 12ba7ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rev-list.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,11 +462,11 @@ int main(int argc, char **argv)
limited = 1;
continue;
}
if (!strncmp(arg, "--merge-order", 13)) {
if (!strcmp(arg, "--merge-order")) {
merge_order = 1;
continue;
}
if (!strncmp(arg, "--show-breaks", 13)) {
if (!strcmp(arg, "--show-breaks")) {
show_breaks = 1;
continue;
}
Expand Down

0 comments on commit 12ba7ea

Please sign in to comment.