diff options
author | markw <markw@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-07-14 00:13:52 +0000 |
---|---|---|
committer | markw <markw@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-07-14 00:13:52 +0000 |
commit | d3c224e1a92df0923d257541c7caaa2ead3e42d7 (patch) | |
tree | 5d84a2fcec7a8297e5426f92590bd4b22b65b9b9 /sed.c | |
parent | b8e3e7e73e81c574cbea3fba806dbc2d48cb495c (diff) | |
download | busybox-w32-d3c224e1a92df0923d257541c7caaa2ead3e42d7.tar.gz busybox-w32-d3c224e1a92df0923d257541c7caaa2ead3e42d7.tar.bz2 busybox-w32-d3c224e1a92df0923d257541c7caaa2ead3e42d7.zip |
Added error checking for edit commands; only a beginning address can be
specified.
git-svn-id: svn://busybox.net/trunk/busybox@844 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'sed.c')
-rw-r--r-- | sed.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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) |