diff options
-rw-r--r-- | editors/sed.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/editors/sed.c b/editors/sed.c index ea99dd856..168a69c5b 100644 --- a/editors/sed.c +++ b/editors/sed.c | |||
@@ -6,6 +6,7 @@ | |||
6 | * Copyright (C) 1999,2000,2001 by Mark Whitley <markw@codepoet.org> | 6 | * Copyright (C) 1999,2000,2001 by Mark Whitley <markw@codepoet.org> |
7 | * Copyright (C) 2002 Matt Kraai | 7 | * Copyright (C) 2002 Matt Kraai |
8 | * Copyright (C) 2003 by Glenn McGrath <bug1@optushome.com.au> | 8 | * Copyright (C) 2003 by Glenn McGrath <bug1@optushome.com.au> |
9 | * Copyright (C) 2003,2004 by Rob Landley <rob@landley.net> | ||
9 | * | 10 | * |
10 | * This program is free software; you can redistribute it and/or modify | 11 | * This program is free software; you can redistribute it and/or modify |
11 | * it under the terms of the GNU General Public License as published by | 12 | * it under the terms of the GNU General Public License as published by |
@@ -410,9 +411,13 @@ static char *parse_cmd_args(sed_cmd_t *sed_cmd, char *cmdstr) | |||
410 | if ((sed_cmd->end_line || sed_cmd->end_match) && sed_cmd->cmd != 'c') | 411 | if ((sed_cmd->end_line || sed_cmd->end_match) && sed_cmd->cmd != 'c') |
411 | bb_error_msg_and_die | 412 | bb_error_msg_and_die |
412 | ("only a beginning address can be specified for edit commands"); | 413 | ("only a beginning address can be specified for edit commands"); |
413 | if (*cmdstr != '\n') /* should not happen */ | 414 | for(;;) { |
414 | bb_error_msg_and_die("A/I/C backslash not followed by NL?"); | 415 | if(*cmdstr=='\n' || *cmdstr=='\\') { |
415 | cmdstr++; /* skip over the NL following the backslash */ | 416 | cmdstr++; |
417 | break; | ||
418 | } else if(isspace(*cmdstr)) cmdstr++; | ||
419 | else break; | ||
420 | } | ||
416 | sed_cmd->string = bb_xstrdup(cmdstr); | 421 | sed_cmd->string = bb_xstrdup(cmdstr); |
417 | parse_escapes(sed_cmd->string,sed_cmd->string,strlen(cmdstr),0,0); | 422 | parse_escapes(sed_cmd->string,sed_cmd->string,strlen(cmdstr),0,0); |
418 | cmdstr += strlen(cmdstr); | 423 | cmdstr += strlen(cmdstr); |