[U-Boot] [PATCH V2] hush: fix some quoted variable expansion issues

Stephen Warren swarren at wwwdotorg.org
Sun Mar 2 06:13:20 CET 2014


On 03/01/2014 05:10 PM, Simon Glass wrote:
> Hi Stephen,
> 
> On 27 February 2014 22:00, Stephen Warren <swarren at wwwdotorg.org
> <mailto:swarren at wwwdotorg.org>> 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.


More information about the U-Boot mailing list