Skip to contentSkip to conversation

Fixlet for argument parsing in rev-list.

PATCH In review Junio C Hamano 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fixlet for argument parsing in rev-list.

The --merge-order flag does not take parameter so there is no point doing strncmp with the length.

---

 rev-list.c |    2 +-
 1 file changed, 1 insertions(+), 1 deletions(-)
rev-list.c +1 -1
@@ -462,7 +462,7 @@ int main(int argc, char **argv)
 			limited = 1;
 			continue;
 		}
-		if (!strncmp(arg, "--merge-order", 13)) {
+		if (!strcmp(arg, "--merge-order")) {
 		        merge_order = 1;
 			continue;
 		}

------------------------------------------------

#1 lore raw

I ack the patch, though --show-breaks could use the same treatment.

jon.

Quoted 24 lines · Junio C Hamano

The --merge-order flag does not take parameter so there is no point doing strncmp with the length.

---

 rev-list.c |    2 +-
 1 file changed, 1 insertions(+), 1 deletions(-)
rev-list.c +1 -2
@@ -462,7 +462,7 @@ int main(int argc, char **argv)
                        limited = 1;
                        continue;
                }
-               if (!strncmp(arg, "--merge-order", 13)) {
+               if (!strcmp(arg, "--merge-order")) {
                        merge_order = 1;
                        continue;
                }
------------------------------------------------
Signature · 2 lines
homepage: http://www.zeta.org.au/~jon/
blog: http://orwelliantremors.blogspot.com/