* editors/sed.c (parse_edit_command): Require a newline after the backslash

after an edit command.
* testsuite/sed/sed-requires-newline-after-edit-command: New.
This commit is contained in:
Matt Kraai 2002-01-02 17:56:38 +00:00
parent 87ac7028e0
commit d21735de2d
2 changed files with 2 additions and 1 deletions

View File

@ -322,7 +322,7 @@ static int parse_edit_cmd(struct sed_cmd *sed_cmd, const char *editstr)
*
*/
if (editstr[1] != '\\' && (editstr[2] != '\n' || editstr[2] != '\r'))
if (editstr[1] != '\\' || (editstr[2] != '\n' && editstr[2] != '\r'))
error_msg_and_die("bad format in edit expression");
/* store the edit line text */

View File

@ -0,0 +1 @@
! busybox sed -e 'i\foo' </dev/null