* 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:
parent
87ac7028e0
commit
d21735de2d
@ -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");
|
error_msg_and_die("bad format in edit expression");
|
||||||
|
|
||||||
/* store the edit line text */
|
/* store the edit line text */
|
||||||
|
1
testsuite/sed/sed-requires-newline-after-edit-command
Normal file
1
testsuite/sed/sed-requires-newline-after-edit-command
Normal file
@ -0,0 +1 @@
|
|||||||
|
! busybox sed -e 'i\foo' </dev/null
|
Loading…
Reference in New Issue
Block a user