diff options
-rw-r--r-- | editors/sed.c | 5 | ||||
-rw-r--r-- | sed.c | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/editors/sed.c b/editors/sed.c index 1eea128d5..115783f09 100644 --- a/editors/sed.c +++ b/editors/sed.c | |||
@@ -361,8 +361,11 @@ static void parse_cmd_str(struct sed_cmd *sed_cmd, const char *cmdstr) | |||
361 | parse_subst_cmd(sed_cmd, &cmdstr[idx]); | 361 | parse_subst_cmd(sed_cmd, &cmdstr[idx]); |
362 | 362 | ||
363 | /* special-case handling for (a)ppend, (i)nsert, and (c)hange */ | 363 | /* special-case handling for (a)ppend, (i)nsert, and (c)hange */ |
364 | if (strchr("aic", cmdstr[idx])) | 364 | if (strchr("aic", cmdstr[idx])) { |
365 | if (sed_cmd->end_line || sed_cmd->end_match) | ||
366 | fatalError("only a beginning address can be specified for edit commands\n"); | ||
365 | parse_edit_cmd(sed_cmd, &cmdstr[idx]); | 367 | parse_edit_cmd(sed_cmd, &cmdstr[idx]); |
368 | } | ||
366 | } | 369 | } |
367 | 370 | ||
368 | static void add_cmd_str(const char *cmdstr) | 371 | static void add_cmd_str(const char *cmdstr) |
@@ -361,8 +361,11 @@ static void parse_cmd_str(struct sed_cmd *sed_cmd, const char *cmdstr) | |||
361 | parse_subst_cmd(sed_cmd, &cmdstr[idx]); | 361 | parse_subst_cmd(sed_cmd, &cmdstr[idx]); |
362 | 362 | ||
363 | /* special-case handling for (a)ppend, (i)nsert, and (c)hange */ | 363 | /* special-case handling for (a)ppend, (i)nsert, and (c)hange */ |
364 | if (strchr("aic", cmdstr[idx])) | 364 | if (strchr("aic", cmdstr[idx])) { |
365 | if (sed_cmd->end_line || sed_cmd->end_match) | ||
366 | fatalError("only a beginning address can be specified for edit commands\n"); | ||
365 | parse_edit_cmd(sed_cmd, &cmdstr[idx]); | 367 | parse_edit_cmd(sed_cmd, &cmdstr[idx]); |
368 | } | ||
366 | } | 369 | } |
367 | 370 | ||
368 | static void add_cmd_str(const char *cmdstr) | 371 | static void add_cmd_str(const char *cmdstr) |