|
From: | Paul Eggert |
Subject: | Re: test -lt inconsistent about white space |
Date: | Sun, 29 Oct 2023 12:20:18 -0700 |
User-agent: | Mozilla Thunderbird |
On 2023-10-29 03:18, Oğuz wrote:
I think the intented behavior was skipping both leading and trailing horizontal whitespace, which makes sense as a QOL feature, and switching over to strtoimax changed this.
If that's the intent, which is self-consistent but which disagrees with all other shells we know about, then a patch differing from what I submitted should be applied. The patch I sent makes Bash self-consistent in a different way, one that is compatible with ksh and Dash. Although I would vote for the latter on compatibility grounds, the former is at least self-consistent.
https://git.savannah.gnu.org/cgit/bash.git/tree/test.c?id=726f63884db0132f01745f1fb4465e6621088ccf#n354
That old code is obviously wrong as it has undefined behavior on integer overflow. So we shouldn't simply revert to it, of course.
[Prev in Thread] | Current Thread | [Next in Thread] |