From: Wolfgang Denk Date: Sun, 02 Sep 2012 20:35:35 +0200 Subject: [U-Boot] [PATCH 1/3] hush: Add default value substitution support In-Reply-To: <201208171931.35608.vapier@gentoo.org> References: <1345235191-13757-1-git-send-email-joe.hershberger@ni.com> <201208171931.35608.vapier@gentoo.org> Message-ID: <20120902183535.0E212203B2F@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Joe, In message <201208171931.35608.vapier@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.