On Tue, Dec 8, 2020 at 12:36 PM Testing Purposes < raspberry.teststr...@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 $ >