Fix sed s//\[newline]/ line continuations.
authorRob Landley <rob@landley.net>
Thu, 22 Jan 2015 08:18:30 +0000 (02:18 -0600)
committerRob Landley <rob@landley.net>
Thu, 22 Jan 2015 08:18:30 +0000 (02:18 -0600)
commit4bb3a3529704989dd9112baece164b2f51b44e89
tree9fa1da25c3e3ad6eb6c73c258516c3c44a60e839
parentef0546d4f536f42a57af4c32bd37f7fd752d10c2
Fix sed s//\[newline]/ line continuations.

The problem was that readline() was returning a newline at the end of each
string, which wasn't getting stripped in the parser and thus \ wasn't at the
end of a line for -f, it was escaping a literal newline, so the continuation
logic didn't trigger. Remove some redundant null checks while we're at it,
and don't bother terminating a string we don't return (yes we leak memory
in an error path, but it's about to error_exit() anyway).
toys/posix/sed.c