Re: [PATCH v4 05/12] Integrate wildmatch to git

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Johannes Sixt <j.sixt@xxxxxxxxxxxxx> writes:

> --- >8 ---
> From: Johannes Sixt <j6t@xxxxxxxx>
> Subject: [PATCH] test-wildmatch: avoid exit code -1
>
> Our bash on Windows does not recognize -1 as failure.
>
> Signed-off-by: Johannes Sixt <j6t@xxxxxxxx>
> ---
>  Please squash this in, in the next round.

I do think the patch is good, but I am curious if people who ported
bash to windows consider this a bug.

Shouldn't the argument to exit() be truncated to its least
significant 8 bits (that is, status & 0377) and be made available to
the waiting parent process (which is bash in this case)?

>  test-wildmatch.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/test-wildmatch.c b/test-wildmatch.c
> index d716852..74c0864 100644
> --- a/test-wildmatch.c
> +++ b/test-wildmatch.c
> @@ -4,11 +4,11 @@
>  int main(int argc, char **argv)
>  {
>  	if (!strcmp(argv[1], "wildmatch"))
> -		return wildmatch(argv[3], argv[2], 0);
> +		return !!wildmatch(argv[3], argv[2], 0);
>  	else if (!strcmp(argv[1], "iwildmatch"))
> -		return wildmatch(argv[3], argv[2], FNM_CASEFOLD);
> +		return !!wildmatch(argv[3], argv[2], FNM_CASEFOLD);
>  	else if (!strcmp(argv[1], "fnmatch"))
> -		return fnmatch(argv[3], argv[2], FNM_PATHNAME);
> +		return !!fnmatch(argv[3], argv[2], FNM_PATHNAME);
>  	else
>  		return 1;
>  }
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]