GNU bug report logs - #30794
Cannot produce backslash through hexadecimal - sed (GNU sed) 4.2.2

Previous Next

Package: sed;

Reported by: 0xddaa <at> gmail.com

Date: Tue, 13 Mar 2018 15:26:01 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Assaf Gordon <assafgordon <at> gmail.com>
To: 0xddaa <0xddaa <at> gmail.com>
Cc: 30794 <at> debbugs.gnu.org
Subject: bug#30794: Cannot produce backslash through hexadecimal - sed (GNU sed) 4.2.2
Date: Tue, 13 Mar 2018 20:45:32 -0600
[Message part 1 (text/plain, inline)]
Hello,

On Tue, Mar 13, 2018 at 06:02:05PM +0800, 0xddaa wrote:
> There is the Proof-of-Concept:
> 
> # echo z | sed 's/z/\x5c/' # \x5c == '\'
> \ # success
> # echo z | sed 's/z/\x5c\x61/'
> a # backslash is gone
> 
> According the manual, *\xxx* should produce an ascii character. sed should
> not treat *\x5c* as an escape symbol.

Thank you for reporting this issue with such clear details
and providing a bug fix - much appreciated!

I expanded your fix by adding tests and news item, see attached patch.

There is a small issue that this is a backwards incompatible change,
and might break some exotic (bad) scripts.

I'll wait for other opinions before pushing this.

Jim,
What do you think?

regards,
 - assaf
[0001-sed-treat-x5c-as-literal-backslash.patch (text/x-diff, attachment)]

This bug report was last modified 7 years and 131 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.