[U-Boot] [PATCH 7/9] setexpr: add regex substring matching and substitution

2013-03-22 Thread Wolfgang Denk
Add "setexpr name gsub r s [t]" and "setexpr name sub r s [t]" commands which implement substring matching for the regular expression in the string , and substitution of the string . The result is assigned to the environment variable . If is not supplied, the previous value of is used instead.

Re: [U-Boot] [PATCH 7/9] setexpr: add regex substring matching and substitution

2013-03-22 Thread Marek Vasut
Dear Wolfgang Denk, > Add "setexpr name gsub r s [t]" and "setexpr name sub r s [t]" > commands which implement substring matching for the regular > expression in the string , and substitution of the string . > The result is assigned to the environment variable . If is > not supplied, the previ

Re: [U-Boot] [PATCH 7/9] setexpr: add regex substring matching and substitution

2013-03-24 Thread Wolfgang Denk
Dear Marek, In message <201303222337.00146.ma...@denx.de> you wrote: > > > +static char *memstr(const char *s1, int l1, const char *s2, int l2) > > +{ > > + if (!l2) > > + return (char *) s1; > > + > > + while (l1 >= l2) { > > + l1--; > > + if (!memcmp(s1, s2, l2)