Bug 113939

Summary: numbered match bug
Product: [Retired] Red Hat Linux Reporter: SEKINE Tatsuo <sekine.t>
Component: sedAssignee: Jakub Jelinek <jakub>
Status: CLOSED CURRENTRELEASE QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: 9   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-06-10 13:57:10 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description SEKINE Tatsuo 2004-01-20 14:44:09 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; ja-JP; rv:1.2.1)
Gecko/20030225

Description of problem:
GNU sed ver. 4.x-4.0.6 have bugs of numbered match substitution.


Version-Release number of selected component (if applicable):
sed-4.0.5-1

How reproducible:
Always

Steps to Reproduce:
1.     echo "x" | sed -n 's/x/SUBST/2p'

Actual Results:  Substitution is not occured.
But the pattern space is "p"rinted as follows:

[prompt]$ echo "x" | sed -n 's/x/SUBST/2p'
x
[prompt]$

Expected Results:  Substitution is not occured, and the patten space
is not printed.

[prompt]$ echo "x" | sed -n 's/x/SUBST/2p'
[prompt]$


Additional info:

This problem was fixed by 4.0.7 release.
From Changelog of 4.0.9 release:

2003-03-23  Paolo Bonzini  <bonzini>

        * sed/execute.c (do_subst): fix several bugs with
        numbered matches
        * testsuite/numsub2.good, testsuite/numsub2.inp,
        testsuite/numsub2.sed, testsuite/numsub3.good,
        testsuite/numsub3.inp, testsuite/numsub3.sed,
        testsuite/numsub4.good, testsuite/numsub4.inp,
        testsuite/numsub4.sed, testsuite/numsub5.good,
        testsuite/numsub5.inp, testsuite/numsub5.sed:
        regression tests for the bugs

Comment 1 SEKINE Tatsuo 2004-06-10 13:57:10 UTC
RH9 is obsolete now, and this bug is fixed on FC2.