|
From: | Paul Eggert |
Subject: | Re: "printf %d ''" should diagnose the empty string |
Date: | Thu, 21 Nov 2024 12:23:48 -0800 |
User-agent: | Mozilla Thunderbird |
On 2024-11-20 23:25, Martin D Kealey wrote:
2. There exist deployed scripts that rely on the current behaviour.
Where? Any such scripts won't work on other shell implementations that do conform to POSIX here.
This behaviour is entirely consistent with strtol(arg,&end,0) where you only check *end==0 and don't check end>arg.
Yes, the behavior is entirely consistent with a common misuse of strtol. :-)
At some point in the past it was deemed appropriate to add a check tantamount to “if (end==arg && posix_mode) fail();”.
Not sure what you're talking about here. I don't see any such check in Bash's past. All I see is a longstanding minor oversight in the Bash source code.
[Prev in Thread] | Current Thread | [Next in Thread] |