[BusyBox 0001392]: -f test not working

bugs at busybox.net bugs at busybox.net
Thu Jun 14 03:43:19 UTC 2007


A NOTE has been added to this issue. 
====================================================================== 
http://busybox.net/bugs/view.php?id=1392 
====================================================================== 
Reported By:                bvoigt
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   1392
Category:                   Standards Compliance
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             06-13-2007 19:11 PDT
Last Modified:              06-13-2007 20:43 PDT
====================================================================== 
Summary:                    -f test not working
Description: 
# [ -f /bin/busybox ] && echo ok || echo bad
bad
# ls -Al /bin/busybox
-rwxr-xr-x    1 root     root       296736 Jun 14 02:07 /bin/busybox

I think I have the syntax right because this used to work, and it also
works in GNU bash.
====================================================================== 

---------------------------------------------------------------------- 
 bvoigt - 06-13-07 20:43  
---------------------------------------------------------------------- 
This bug is caused by revision 18801

------------------------------------------------------------------------
r18801 | aldot | 2007-06-12 08:21:08 -0500 (Tue, 12 Jun 2007) | 2 lines
Changed paths:
   M /trunk/busybox/coreutils/test.c

- fix testing primary expressions like '"-u" = "-u"'

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

Index: test.c
===================================================================
--- test.c      (revision 18800)
+++ test.c      (revision 18801)
@@ -224,7 +224,7 @@
        if (argc == 2)
                return *argv[1] == '\0';
 //assert(argc);
-       if (LONE_CHAR(argv[1], '!')) {
+       {
                bool _off;
                if (argc == 3)
                        return *argv[2] != '\0';
@@ -232,7 +232,7 @@
                t_lex(argv[2 + _off]);
                if (t_wp_op && t_wp_op->op_type == BINOP) {
                        t_wp = &argv[1 + _off];
-                       return binop() == 1;
+                       return binop() == (LONE_CHAR(argv[1], '!'));
                }
        }
        t_wp = &argv[1]; 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
06-13-07 19:11  bvoigt         New Issue                                    
06-13-07 19:11  bvoigt         Status                   new => assigned     
06-13-07 19:11  bvoigt         Assigned To               => BusyBox         
06-13-07 20:43  bvoigt         Note Added: 0002482                          
======================================================================




More information about the busybox-cvs mailing list