aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editors/sed.c2
-rwxr-xr-xtestsuite/sed.tests21
2 files changed, 22 insertions, 1 deletions
diff --git a/editors/sed.c b/editors/sed.c
index e625a0965..3a0d917aa 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -330,7 +330,7 @@ static int get_address(const char *my_str, int *linenum, regex_t ** regex)
330 next = index_of_next_unescaped_regexp_delim(delimiter, ++pos); 330 next = index_of_next_unescaped_regexp_delim(delimiter, ++pos);
331 temp = copy_parsing_escapes(pos, next); 331 temp = copy_parsing_escapes(pos, next);
332 *regex = xzalloc(sizeof(regex_t)); 332 *regex = xzalloc(sizeof(regex_t));
333 xregcomp(*regex, temp, G.regex_type|REG_NEWLINE); 333 xregcomp(*regex, temp, G.regex_type);
334 free(temp); 334 free(temp);
335 /* Move position to next character after last delimiter */ 335 /* Move position to next character after last delimiter */
336 pos += (next+1); 336 pos += (next+1);
diff --git a/testsuite/sed.tests b/testsuite/sed.tests
index 468565f47..2af1e4c97 100755
--- a/testsuite/sed.tests
+++ b/testsuite/sed.tests
@@ -310,6 +310,27 @@ testing "sed zero chars match/replace logic must not falsely trigger here 2" \
310 "sed 's/ *$/_/g'" \ 310 "sed 's/ *$/_/g'" \
311 "qwerty_\n" "" "qwerty\n" 311 "qwerty_\n" "" "qwerty\n"
312 312
313testing "sed /\$_in_regex/ should not match newlines, only end-of-line" \
314 "sed ': testcont; /\\\\$/{ =; N; b testcont }'" \
315 "\
316this is a regular line
3172
318line with \\
319continuation
320more regular lines
3215
322line with \\
323continuation
324" \
325 "" "\
326this is a regular line
327line with \\
328continuation
329more regular lines
330line with \\
331continuation
332"
333
313# testing "description" "commands" "result" "infile" "stdin" 334# testing "description" "commands" "result" "infile" "stdin"
314 335
315exit $FAILCOUNT 336exit $FAILCOUNT