Bug 8251

Summary: sed not replace the words after Implement "+ N" range end
Product: Busybox Reporter: Taapat <taapat>
Component: Standard ComplianceAssignee: unassigned
Status: RESOLVED FIXED    
Severity: normal CC: busybox-cvs
Priority: P5    
Version: 1.24.x   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target:
Build:

Description Taapat 2015-08-02 08:46:39 UTC
I am using the latest busybox from git. After this commit: http://git.busybox.net/busybox/commit/?id=63f4d32c9859c1ed341debefddad4b9c0ae944cc
I see strange things when use sed to replace words. Sometimes replace works, but sometimes not.

For example these replace foo in file test.txt as I expect:
sed -i 's/foo/bar/w' test.txt
sed -i 's/foo/bar-1/w' test.txt
sed -i 's/foo/t/w' test.txt
sed -i 's/foo/technic-1/w' test.txt
sed -i 's/foo/technical/w' test.txt

But these do no replace foo:
sed -i 's/foo/t-1/w' test.txt
sed -i 's/foo/t-2/w' test.txt
sed -i 's/foo/technical-1/w' test.txt
sed -i 's/foo/TemplatesInfoBarTechnical-1/w' test.txt

If I revert implement "+ N" range end commit, words replaces in all cases.
Comment 1 Denys Vlasenko 2016-01-24 14:54:54 UTC
Well, /w FILE option to s/// command never worked. I fixed this.
Now it works for me.
If you still have a problem, please reopen and attach your test.txt