Woops, remove the code i didnt mean to commit

This commit is contained in:
Glenn L McGrath 2003-03-09 02:44:49 +00:00
parent d5eadea970
commit 2f8a401772

View File

@ -442,36 +442,29 @@ static char *parse_cmd_str(struct sed_cmd * const sed_cmd, const char *const cmd
error_msg_and_die("missing command"); error_msg_and_die("missing command");
sed_cmd->cmd = cmdstr[idx]; sed_cmd->cmd = cmdstr[idx];
switch (sed_cmd->cmd) { /* if it was a single-letter command that takes no arguments (such as 'p'
/* if it was a single-letter command that takes no arguments (such as 'p' * or 'd') all we need to do is increment the index past that command */
* or 'd') all we need to do is increment the index past that command */ if (strchr("pd=", sed_cmd->cmd)) {
case 'p': idx++;
case 'd': }
case '=': /* handle (s)ubstitution command */
idx++; else if (sed_cmd->cmd == 's') {
break; idx += parse_subst_cmd(sed_cmd, &cmdstr[idx]);
/* handle (s)ubstitution command */ }
case 's': /* handle edit cmds: (a)ppend, (i)nsert, and (c)hange */
idx += parse_subst_cmd(sed_cmd, &cmdstr[idx]); else if (strchr("aic", sed_cmd->cmd)) {
break; if ((sed_cmd->end_line || sed_cmd->end_match) && sed_cmd->cmd != 'c')
/* handle edit cmds: (a)ppend, (i)nsert, and (c)hange */ error_msg_and_die("only a beginning address can be specified for edit commands");
case 'a': idx += parse_edit_cmd(sed_cmd, &cmdstr[idx]);
case 'i': }
case 'c': /* handle file cmds: (r)ead */
if ((sed_cmd->end_line || sed_cmd->end_match) && sed_cmd->cmd != 'c') { else if (sed_cmd->cmd == 'r') {
error_msg_and_die("only a beginning address can be specified for edit commands"); if (sed_cmd->end_line || sed_cmd->end_match)
} error_msg_and_die("Command only uses one address");
idx += parse_edit_cmd(sed_cmd, &cmdstr[idx]); idx += parse_file_cmd(sed_cmd, &cmdstr[idx]);
break; }
/* handle file cmds: (r)ead */ else {
case 'r': error_msg_and_die("Unsupported command %c", sed_cmd->cmd);
if (sed_cmd->end_line || sed_cmd->end_match) {
error_msg_and_die("Command only uses one address");
}
idx += parse_file_cmd(sed_cmd, &cmdstr[idx]);
break;
default:
error_msg_and_die("Unsupported command %c", sed_cmd->cmd);
} }
/* give back whatever's left over */ /* give back whatever's left over */