[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bash 5.1: rl_readline_version = 0x801 (shouldn't it be 0x0801 ?)
From: |
Clark Wang |
Subject: |
Re: Bash 5.1: rl_readline_version = 0x801 (shouldn't it be 0x0801 ?) |
Date: |
Tue, 8 Dec 2020 13:56:18 +0800 |
On Tue, Dec 8, 2020 at 12:36 PM Testing Purposes <
raspberry.teststream@gmail.com> wrote:
> But Readline's official documentation specifically chose an example with a
> leading zero — 0x0402. It says that Readline 4.2 should have a version
> value of 0x0402, not 0x402.
>
Could you point me to where it says 0x402 is wrong?
>
> Therefore, based on the documentation, there should still be a way to
> extract the full, 0xMMmm-formatted value for rl_readline_version.
>
> The Readline documentation explicitly states that the value should consist
> of a "*two-digit* major version number" (MM) plus a "*two-digit* minor
> version number" (mm). In other words, the output format should always
> be 0xMMmm.
>
I'd interpret the two-digit as "at most two digits". For 0x402, MM is "04"
and mm is "02".
>
> All contemporary versions of Readline consist of a single-digit integer
> for the major version number. That won't change until we get to version 10
> of Readline.
>
It sounds to me that the "two digits" are in HEX format (0xMMmm) so when it
reaches version 10 it'll be 0x0a00.
> That means, for now, all major version numbers of Readline, when formatted
> as a two-digit number, would always contain a leading zero — so there's
> nothing unusual about this scenario.
>
> So there should be a way to extract the full and proper 0xMMmm format, as
> the example in the documentation indicates.
>
You can
$ printf '0x%04x\n' 0x402
0x0402
$ printf '0x%04x\n' 0x801
0x0801
$
>
- Bash 5.1: rl_readline_version = 0x801 (shouldn't it be 0x0801 ?), Testing Purposes, 2020/12/07
- Re: Bash 5.1: rl_readline_version = 0x801 (shouldn't it be 0x0801 ?), Clark Wang, 2020/12/07
- Re: Bash 5.1: rl_readline_version = 0x801 (shouldn't it be 0x0801 ?), Andreas Schwab, 2020/12/08
- Re: [EXT] Re: Bash 5.1: rl_readline_version = 0x801 (shouldn't it be 0x0801 ?), Greg Wooledge, 2020/12/08
- Re: [EXT] Re: Bash 5.1: rl_readline_version = 0x801 (shouldn't it be 0x0801 ?), Andreas Schwab, 2020/12/08
- Re: [EXT] Re: Bash 5.1: rl_readline_version = 0x801 (shouldn't it be 0x0801 ?), L A Walsh, 2020/12/09
- Re: Bash 5.1: rl_readline_version = 0x801 (shouldn't it be 0x0801 ?), Testing Purposes, 2020/12/08
- Re: Bash 5.1: rl_readline_version = 0x801 (shouldn't it be 0x0801 ?), Lawrence Velázquez, 2020/12/08
- Re: Bash 5.1: rl_readline_version = 0x801 (shouldn't it be 0x0801 ?), Testing Purposes, 2020/12/08
- Re: Bash 5.1: rl_readline_version = 0x801 (shouldn't it be 0x0801 ?), Chet Ramey, 2020/12/08