# [PATCH] Fixlet for argument parsing in rev-list.

2 messages from 2005-07-05 to 2005-07-05. Participants: Junio C Hamano, Jon Seymour.
Thread: https://gitlist.dev/t/1110

## Junio C Hamano, 2005-07-05 07:54

Subject: [PATCH] Fixlet for argument parsing in rev-list.
Message-ID: <7vpstxg02q.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vpstxg02q.fsf%40assigned-by-dhcp.cox.net

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

Signed-off-by: Junio C Hamano <junkio@cox.net>
---

 rev-list.c |    2 +-
 1 file changed, 1 insertions(+), 1 deletions(-)

diff --git a/rev-list.c b/rev-list.c
--- a/rev-list.c
+++ b/rev-list.c
@@ -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;
 		}
------------------------------------------------

```

## Jon Seymour, 2005-07-05 09:14

Subject: Re: [PATCH] Fixlet for argument parsing in rev-list.
Message-ID: <2cfc40320507050214154c0fff@mail.gmail.com>
URL: https://gitlist.dev/e/2cfc40320507050214154c0fff%40mail.gmail.com
In-Reply-To: <7vpstxg02q.fsf@assigned-by-dhcp.cox.net>

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

jon.

On 7/5/05, Junio C Hamano <junkio@cox.net> wrote:
> The --merge-order flag does not take parameter so there is no
> point doing strncmp with the length.
> 
> Signed-off-by: Junio C Hamano <junkio@cox.net>
> ---
> 
>  rev-list.c |    2 +-
>  1 file changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/rev-list.c b/rev-list.c
> --- a/rev-list.c
> +++ b/rev-list.c
> @@ -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;
>                 }
> ------------------------------------------------
> 
> 


-- 
homepage: http://www.zeta.org.au/~jon/
blog: http://orwelliantremors.blogspot.com/

```
