/* 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 */
- if (strchr("pd", sed_cmd->cmd)) {
+ if (strchr("pd=", sed_cmd->cmd)) {
idx++;
}
/* handle (s)ubstitution command */
idx += parse_file_cmd(sed_cmd, &cmdstr[idx]);
}
else {
- error_msg_and_die("invalid command");
+ error_msg_and_die("Unsupported command %c", sed_cmd->cmd);
}
/* give back whatever's left over */
* actual sedding
*/
switch (sed_cmd->cmd) {
-
+ case '=':
+ printf("%d\n", linenum);
+ break;
case 'p':
puts(line);
break;