Thierry Vignaud <[EMAIL PROTECTED]> writes:

> latest coreutils wrongly assume the same behavior for both test and [
> programs.
> 
> however, whereas it's ok for test to be called as in "test toto -eq
> tata ]" , "[" call must be finished by a "]" as in "[ toto -eq tata ]"
> 
> this bug is often silently unseen because most shells (especially most
> used ones such as bash, zsh and the like) provide a builtin [ command,
> thus hiding this bug.
> 
> csh like shells such as tcsh do not provide builtin [ command and thus
> unhide this bug.
> 
> 
> see http://qa.mandrakesoft.com/show_bug.cgi?id=6736 for reference
> 
> 
> the following patch fix that bug:
> --- ./src/test.c.tv   2004-01-07 12:36:21.000000000 +0100
> +++ ./src/test.c      2004-01-07 13:06:06.000000000 +0100
> @@ -1091,7 +1091,7 @@
>  
>    argv = margv;
>  
> -  if (LBRACKET)
> +  if (strcmp (margv[0], "[") != 0)
>      {
>        /* Recognize --help or --version, but only when invoked in the
>        "[" form, and when the last argument is not "]".  POSIX

oops, i sent the wrong patch:
--- ./src/test.c.tv	2004-01-07 12:36:21.000000000 +0100
+++ ./src/test.c	2004-01-07 13:06:06.000000000 +0100
@@ -1091,7 +1091,7 @@
 
   argv = margv;
 
-  if (LBRACKET)
+  if (strcmp (margv[0], "[") == 0)
     {
       /* Recognize --help or --version, but only when invoked in the
 	 "[" form, and when the last argument is not "]".  POSIX
_______________________________________________
Bug-coreutils mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to