All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hiroshi Ito <ito@mlb.co.jp>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] test command bug.
Date: Fri, 26 Nov 2004 21:09:51 +0900	[thread overview]
Message-ID: <20041126210951T.ito@mlb.co.jp> (raw)

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;

             reply	other threads:[~2004-11-26 12:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-26 12:09 Hiroshi Ito [this message]
2005-04-05 23:36 ` [U-Boot-Users] [PATCH] test command bug Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041126210951T.ito@mlb.co.jp \
    --to=ito@mlb.co.jp \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.