[U-Boot] [PATCH v4 6/7] env: make "env default" selective, check and apply

Wolfgang Denk
2012-09-02T11:58:45Z

Dear Marek Vasut,

In message <201208242310.05189.marek.vasut@gmail.com> you wrote:
>
> > >> + while (--argc> 0&& **++argv == '-') {
> > >
> > > mmmmm ... **++argv, yummy :) This might use some cleanup, to make more
> > > readable.
> >
> > Uhm, this pattern is being used all over the place on that file (that's
> > where I copied it from).
>
> That doesn't mean it's right, it just means the codebase is in a very sad state
> :-C

Define "right".

And what makes you think the way K&R implemented such stuff would be
a "very sad state"? See for example the code from Unix Version 6:

"ls" command:

if (--argc > 0 && *argv[1] == '-') {

or "grep":

while (--argc > 0 && (++argv)[0][0]=='-')

etc. etc.

Any C beginner's class is supposed to be able to parse this...

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
Conceptual integrity in turn dictates that the design must proceed
from one mind, or from a very small number of agreeing resonant
minds. - Frederick Brooks Jr., "The Mythical Man Month"