From 32b3587af261c2fb416f5de1be8f00fd5c1283d5 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Wed, 17 Feb 2016 19:21:44 -0600 Subject: The perl build's attempt to escape spaces and such in LD_LIBRARY_PATH is _SAD_. It uses a sed expression that assumes you can escape - to use it as a literal (you can't, it has to be first or last char of the range), and assumes you have to escape delimiters in sed [] context (you don't), and/or that non-printf escapes become the literal character (they don't, the backslash is preserved as a literal), meaning it winds up doing "s/[\-\]//" which is a length 1 range, which is officially undefined behavior according to posix, and regcomp errors out. But if we don't accept it (like other implementations do) the perl build breaks. So collapse [A-A] into just [A]. Testcae taken from perl 5.22.0 file Makefile.SH line 8. (While we're at it, remove an unused argument from a function.) --- tests/sed.test | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests/sed.test') diff --git a/tests/sed.test b/tests/sed.test index eff2306a..c62f9c4d 100755 --- a/tests/sed.test +++ b/tests/sed.test @@ -131,10 +131,13 @@ hello'" "merp\nhello\n" "" "merp" testing "" "sed -e '/x/c\' -e 'y'" 'y\n' '' 'x\n' testing "" "sed -e 's/a[([]*b/X/'" 'X' '' 'a[(b' +testing "" "sed 'y/a\\bc/de\f/'" "db\f" "" "abc" +testing "sed [a-a] (for perl)" "sed '"'s/\([^a-zA-Z0-9.:_\-\/]\)/\\\1/g'"'" \ + 'he\ llo' "" "he llo" # You have to match the first line of a range in order to activate # the range, numeric and ascii work the same way -testing "skip start of range" "sed -e n -e '1,2s/b/c/'" "a\nb\n" "" "a\nb\n" +testing "sed skip start of range" "sed -e n -e '1,2s/b/c/'" "a\nb\n" "" "a\nb\n" #echo meep | sed/sed -e '1a\' -e 'huh' #echo blah | sed/sed -f <(echo -e "1a\\\\\nboom") @@ -146,4 +149,5 @@ testing "sed bonus backslashes" \ "hello\nl x\nab\nc\n" "" "hello\n" # -i with $ last line test + exit $FAILCOUNT -- cgit v1.2.3