[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] _rl_untranslate_macro_value with meta control chars
From: |
G. Branden Robinson |
Subject: |
Re: [PATCH] _rl_untranslate_macro_value with meta control chars |
Date: |
Thu, 3 Aug 2023 16:35:18 -0500 |
Hi Grisha,
At 2023-08-03T15:52:21-0400, Grisha Levit wrote:
> Note that my output for the "PI" cases was not piped through `cat -v',
> nor otherwise translated for email -- that was the literal text being
> written by `bind -s'. I'm assuming your output (without `cat -v') had
> actual `π' characters.
Yes, it did.
> The output actually depends on the signedness of char on your
> platform:
>
> $ uname -sp
> Linux aarch64
> $ getconf CHAR_MAX
> 255
> $ (bind '"PI": "π"'; bind -s)
> "PI": "\M-O\M-"
>
> $ uname -sp
> Linux x86_64
> $ getconf CHAR_MAX
> 127
> $ (bind '"PI": "π"'; bind -s)
> "PI": "π"
Ahh, that comparison sheds much light. Thanks!
I'm surprised that differences in char signedness weren't flushed out
when Bash was ported to PowerPC, though.
> I suspect the behavior difference is not intentional. The code seems
> to have been written with the goal of producing output without the
> high bit set so is missing some `(unsigned char)' casts.
I remember it getting messy around there.
https://lists.gnu.org/archive/html/bug-bash/2016-02/msg00185.html
Regards,
Branden
signature.asc
Description: PGP signature