[Top][All Lists]

[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: Testing Purposes
Subject: Re: Bash 5.1: rl_readline_version = 0x801 (shouldn't it be 0x0801 ?)
Date: Mon, 7 Dec 2020 23:36:09 -0500

On Mon, Dec 7, 2020 at 9:30 PM Eastern Time, Clark Wang wrote:

The integer 0x801 is the same as 0x0801.
> # echo $(( 0x801 ))
> 2049
> # echo $(( 0x0801 ))
> 2049
> # echo $(( 0x00000801 ))
> 2049
> #

>From an integer standpoint, I know that 08 (with one leading zero) is the
same as 8.

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.

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.

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.  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.

At a minimum, this is important to avoid confusion when people are simply
trying to determine what version of Readline came bundled with their build
of Bash.

If anyone knows how to do this, please let the mailing list know.

reply via email to

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