[U-Boot] [PATCH 1/3] hush: Add default value substitution	support
    Wolfgang Denk 
    wd at denx.de
       
    Sun Sep  2 20:35:35 CEST 2012
    
    
  
Dear Joe,
In message <201208171931.35608.vapier at gentoo.org> Mike Frysinger wrote:
>
> > ${VAR:-default}
...
> > ${VAR:=default}
...
> > ${VAR:+default}
...
> how about ${VAR-default} and ${VAR=default} and ${VAR+default} ?
Maybe we (= you?) can add these, too?
> > +		if (assign) {
> > +			char *var = malloc(strlen(src)+strlen(default_val)+2);
> 
> please put spaces around the "+"
Ah, I missed that.
> > +			if (var) {
> > +				sprintf(var, "%s=%s", src, default_val);
> > +				set_local_var(var, 0);
> > +			}
> 
> isn't there a helper func for this ?
Eventually we can lean this up in another patch, please?
Best regards,
Wolfgang Denk
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The ideal situation is to have massive computing power right at home.
Something that dims the streetlights and shrinks the picture  on  the
neighbours' TVs when you boot it up.
    
    
More information about the U-Boot
mailing list