From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Sat, 01 Mar 2014 22:13:20 -0700 Subject: [U-Boot] [PATCH V2] hush: fix some quoted variable expansion issues In-Reply-To: References: <1393563654-16490-1-git-send-email-swarren@wwwdotorg.org> Message-ID: <5312BDF0.1010107@wwwdotorg.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 03/01/2014 05:10 PM, Simon Glass wrote: > Hi Stephen, > > On 27 February 2014 22:00, Stephen Warren > wrote: > > The following shell command fails: > > if test -z "$x"; then echo "zero"; else echo "non-zero"; fi > > (assuming $x does not exist, it prints "non-zero" rather than "zero"). ... > @@ -2470,8 +2473,14 @@ static int done_word(o_string *dest, struct > p_context *ctx) > argc = ++child->argc; > child->argv = realloc(child->argv, > (argc+1)*sizeof(*child->argv)); > if (child->argv == NULL) return 1; > + child->argv_nonnull = realloc(child->argv_nonnull, > + > (argc+1)*sizeof(*child->argv_nonnull)); > + if (child->argv_nonnull == NULL) > + return 1; > child->argv[argc-1]=str; > + child->argv_nonnull[argc-1] = dest->nonnull; > child->argv[argc]=NULL; > + child->argv_nonnull[argc] = 0; > > > NULL to be consistent? This is assigning an entry in the array, and the entry type is int. I'll fix up the other issues.