GNU bug report logs -
#22254
[PATCH] sed: do not elide an invalid byte in a substitution RHS
Previous Next
Reported by: Jim Meyering <jim <at> meyering.net>
Date: Mon, 28 Dec 2015 06:04:01 UTC
Severity: normal
Tags: patch
Done: Jim Meyering <jim <at> meyering.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Mon, 28 Dec 2015 22:18:22 -0800
with message-id <CA+8g5KGJiRo7pv0uRRBuCyW11=TFKJEno-QXMe6h+gzXtu0EHA <at> mail.gmail.com>
and subject line Re: bug#22254: [PATCH] sed: do not elide an invalid byte in a substitution RHS
has caused the debbugs.gnu.org bug report #22254,
regarding [PATCH] sed: do not elide an invalid byte in a substitution RHS
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
22254: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22254
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
[Message part 3 (text/plain, inline)]
Just after pushing the fix for that heap-clobbering bug,
http://debbugs.gnu.org/22127, I noticed there was another minor
problem: sed would silently elide any invalid byte specified in a
substitution replacement string.
Here's a patch that's not quite complete (no NEWS entry, and I haven't
yet tried to determine when it was introduced).
[0001-sed-do-not-elide-an-invalid-byte-in-a-substitution-R.patch (text/x-patch, attachment)]
[Message part 5 (message/rfc822, inline)]
On Sun, Dec 27, 2015 at 10:42 PM, Jim Meyering <jim <at> meyering.net> wrote:
> On Sun, Dec 27, 2015 at 10:24 PM, Jim Meyering <jim <at> meyering.net> wrote:
>> On Sun, Dec 27, 2015 at 10:02 PM, Jim Meyering <jim <at> meyering.net> wrote:
>>> Just after pushing the fix for that heap-clobbering bug,
>>> http://debbugs.gnu.org/22127, I noticed there was another minor
>>> problem: sed would silently elide any invalid byte specified in a
>>> substitution replacement string.
>>>
>>> Here's a patch that's not quite complete (no NEWS entry, and I haven't
>>> yet tried to determine when it was introduced).
>>
>> This one has a checkered past. I keep a decent sampling of old
>> versions of sed around.
>> Running one of the two tests that would be affected shows how
>> treatment of an invalid byte in a multi-byte locale has differed over
>> the years:
>>
>> $ for i in $(env ls -dv /p/p/sed-*); do printf '%-14s: ' $i; echo a
>> |LC_ALL=ja_JP $i/bin/sed 's/a/b\U\xb2c/'|od -tx1|head -1; done|sed
>> s/.....//
>> sed-1.18 : 0000000 62 55 78 62 32 63 0a
>> sed-2.05 : 0000000 62 55 78 62 32 63 0a
>> sed-3.01 : 0000000 62 55 78 62 32 63 0a
>> sed-3.02 : 0000000 62 55 78 62 32 63 0a
>> sed-4.0a : 0000000 62 00 43 0a
...
>> sed-4.0e : 0000000 62 00 43 0a
>> sed-4.0.6: 0000000 62 b2 43 0a
>> sed-4.0.7: 0000000 62 b2 43 0a
>> sed-4.0.8: 0000000 62 b2 43 0a
>> sed-4.0.9: 0000000 62 b2 43 0a
>> sed-4.1 : 0000000 62 00 43 0a
...
>> sed-4.2.2: 0000000 62 00 43 0a
>>
>> Now, it does what 4.0.6..4.0.9 did.
>
> Here's a complete patch:
Pushed.
This bug report was last modified 9 years and 231 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.