bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: test -lt inconsistent about white space


From: Oğuz
Subject: Re: test -lt inconsistent about white space
Date: Sun, 29 Oct 2023 13:18:29 +0300

On Sun, Oct 29, 2023 at 8:49 AM Paul Eggert <eggert@cs.ucla.edu> wrote:
> My understanding is that Bash was intended to allow both leading and
> trailing whitespace. This is compatible with ksh and with Dash. If
> that's the intent, Bash should be consistent about it, just as ksh and
> Dash are. There seems little point to allowing one nonempty set of
> whitespace characters before the integer, and a different nonempty set
> of whitespace characters afterwards.
legal_number was isint, which skipped both leading and trailing space
using the whitespace macro. See here:
https://git.savannah.gnu.org/cgit/bash.git/tree/test.c?id=726f63884db0132f01745f1fb4465e6621088ccf#n354
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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]