bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gawk] print statement problem with hexadecimal escape sequence


From: arnold
Subject: Re: [bug-gawk] print statement problem with hexadecimal escape sequence
Date: Thu, 03 May 2018 14:54:51 -0600
User-agent: Heirloom mailx 12.4 7/29/08

The mails from Manuel and Andrew are on the mark. Gawk's previous
behaviour of using as many hex digits as were there was documented
in the manual (and I think in the man page too).

As noted, it changed in 4.2.

Thanks for taking the time to report an issue.

Arnold

"Andrew J. Schorr" <address@hidden> wrote:

> On Thu, May 03, 2018 at 09:15:43AM +0900, Hyunho Cho wrote:
> > 
> > 
> > There is a erroneous print result with "\xHH" escape sequence that is 
> > immediately followed by hexadecimal value (0-9a-f)
> > 
> > $ gawk --version
> > GNU Awk 4.1.4, API: 1.1 (GNU MPFR 3.1.6, GNU MP 6.1.2)
> > Copyright (C) 1989, 1991-2016 Free Software Foundation.
> ...
> > # There is a problem because "F" is hex character that immediately follwing 
> > "\xHH" escape sequence.
> > 
> > $ awk 'BEGIN { print "\x41\x42\x43FFF" }'  | od -a
> > 0000000   A   B del  nl
> > 0000004
>
> Have you tried the current version 4.2.1? I believe this has been fixed:
>
> bash-4.2$ ./gawk 'BEGIN { print "\x41\x42\x43FFF" }'  | od -a
> 0000000   A   B   C   F   F   F  nl
> 0000007
>
> From the NEWS:
>
> Changes from 4.1.4 to 4.2.0
> ---------------------------
> 6. Gawk now processes a maximum of two hexadecimal digits in \x
>    escape sequences inside strings.
>
> Regards,
> Andy



reply via email to

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