char *dest = xmalloc(len + 1);
parse_escapes(dest, string, len, 'n', '\n');
- /* GNU sed also recognizes \t */
+ /* GNU sed also recognizes \t and \r */
parse_escapes(dest, dest, strlen(dest), 't', '\t');
+ parse_escapes(dest, dest, strlen(dest), 'r', '\r');
return dest;
}
"cp input input2; sed -i -e '1s/foo/bar/' input input2 && cat input input2; rm input2" \
"bar\nbar\n" "foo\n" ""
+testing "sed understands \r" \
+ "sed 's/r/\r/'" \
+ "\rrr\n" "" "rrr\n"
# testing "description" "arguments" "result" "infile" "stdin"