diff options
author | Denys Vlasenko | 2009-08-17 01:35:04 +0200 |
---|---|---|
committer | Denys Vlasenko | 2009-08-17 01:35:04 +0200 |
commit | f210cff601cf034c522b41cae6acd4f56060126d (patch) | |
tree | 5d65de6fa4eccdb44448cef2baf9efb65b4ab40e /testsuite/sed.tests | |
parent | 16d1e3c26fc2908d430aa94cc76227028b0fffc7 (diff) | |
download | busybox-f210cff601cf034c522b41cae6acd4f56060126d.zip busybox-f210cff601cf034c522b41cae6acd4f56060126d.tar.gz |
sed: fix " echo /usr/lib | sed 's,\(^/\|\)[^/][^/]*,..,g' " bug
function old new delta
process_files 2102 2091 -11
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite/sed.tests')
-rwxr-xr-x | testsuite/sed.tests | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/testsuite/sed.tests b/testsuite/sed.tests index a9d9ada..696d980 100755 --- a/testsuite/sed.tests +++ b/testsuite/sed.tests @@ -241,4 +241,11 @@ testing "sed 2d;2,1p (gnu compat)" \ "third\n" "" \ "first\nsecond\nthird\nfourth\n" +# Regex means: "match / at BOL or nothing, then one or more not-slashes". +# The bug was that second slash in /usr/lib was treated as "at BOL" too. +testing "sed beginning (^) matches only once" \ + "sed 's,\(^/\|\)[^/][^/]*,>\0<,g'" \ + ">/usr</>lib<\n" "" \ + "/usr/lib\n" + exit $FAILCOUNT |