Re: [PATCH] lib: Improve _parse_integer_fixup_radix base 16 detection

2020-02-19 Thread Michal Simek
čt 13. 2. 2020 v 13:30 odesílatel Tom Rini napsal: > > On Thu, Feb 13, 2020 at 08:33:09AM +0100, Michal Simek wrote: > > pá 7. 2. 2020 v 13:07 odesílatel Michal Simek > > napsal: > > > > > > Base autodetection is failing for this case: > > > if test 257 -gt 3ae; then echo first; else echo second

Re: [PATCH] lib: Improve _parse_integer_fixup_radix base 16 detection

2020-02-13 Thread Tom Rini
On Thu, Feb 13, 2020 at 08:33:09AM +0100, Michal Simek wrote: > pá 7. 2. 2020 v 13:07 odesílatel Michal Simek > napsal: > > > > Base autodetection is failing for this case: > > if test 257 -gt 3ae; then echo first; else echo second; fi > > > > It is because base for 3ae is recognized by _parse_in

Re: [PATCH] lib: Improve _parse_integer_fixup_radix base 16 detection

2020-02-12 Thread Michal Simek
pá 7. 2. 2020 v 13:07 odesílatel Michal Simek napsal: > > Base autodetection is failing for this case: > if test 257 -gt 3ae; then echo first; else echo second; fi > > It is because base for 3ae is recognized by _parse_integer_fixup_radix() as > 10. The patch is checking all chars to make sure tha

[PATCH] lib: Improve _parse_integer_fixup_radix base 16 detection

2020-02-07 Thread Michal Simek
Base autodetection is failing for this case: if test 257 -gt 3ae; then echo first; else echo second; fi It is because base for 3ae is recognized by _parse_integer_fixup_radix() as 10. The patch is checking all chars to make sure that they are not 'a' or up. If they are base needs to be in hex. Si