public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] [PATCH] test command bug.
@ 2004-11-26 12:09 Hiroshi Ito
  2005-04-05 23:36 ` Wolfgang Denk
  0 siblings, 1 reply; 2+ messages in thread
From: Hiroshi Ito @ 2004-11-26 12:09 UTC (permalink / raw)
  To: u-boot

Hello, I'm new to this list.

u-boot-1.1.2 ( cvs version )
# if test -z "" ; then echo true; else echo false; fi
false
# if test -n "" ; then echo true; else echo false; fi
true
#

The logic is reversed.

patch is attached.
--------
Hiroshi Ito
Media Lab. Inc.,
URL http://www.mlb.co.jp ( Sorry, Japanese only. )
TEL +81-3-5294-7255  FAX +81-3-5294-7256
-------------- next part --------------
Index: common/command.c
===================================================================
RCS file: /cvsroot/u-boot/u-boot/common/command.c,v
retrieving revision 1.17
diff -u -b -B -w -p -r1.17 command.c
--- common/command.c	18 Apr 2004 17:39:39 -0000	1.17
+++ common/command.c	26 Nov 2004 12:06:12 -0000
@@ -136,9 +136,9 @@ do_test (cmd_tbl_t *cmdtp, int flag, int
 
 		if (adv == 2) {
 			if (strcmp(ap[0], "-z") == 0)
-				expr = strlen(ap[1]) == 0 ? 0 : 1;
-			else if (strcmp(ap[0], "-n") == 0)
 				expr = strlen(ap[1]) == 0 ? 1 : 0;
+			else if (strcmp(ap[0], "-n") == 0)
+				expr = strlen(ap[1]) == 0 ? 0 : 1;
 			else {
 				expr = 1;
 				break;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-04-05 23:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-26 12:09 [U-Boot-Users] [PATCH] test command bug Hiroshi Ito
2005-04-05 23:36 ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox