On Mon, Jun 11, 2007 at 05:39:16PM +0200, Bernhard Fischer wrote: >On Mon, Jun 11, 2007 at 03:31:24PM +0200, Milos Wimmer wrote: >> >> Hello, >> >>I found another bug in busybox-1.6.0 test applet. >> >>./busybox-1.5.0 sh >>$ GMT="-u" >>$ [ "$GMT" = "-u" ] && echo ok >>ok >> >> >>./busybox-1.6.0 sh >>$ GMT="-u" >>$ [ "$GMT" = "-u" ] && echo ok >>sh: -u: unknown operand > >hmz. The NOT operator check is completely wrong there. testing a fix..
Can you please try the attached patch? We really need some testsuite/test tests.. :-( Any volunteers / takers?
Index: coreutils/test.c =================================================================== --- coreutils/test.c (revision 18794) +++ coreutils/test.c (working copy) @@ -224,7 +224,7 @@ int bb_test(int argc, char **argv) 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 @@ int bb_test(int argc, char **argv) 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];
_______________________________________________ busybox mailing list busybox@busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox