* part1 part2 part3
*/
+ /* skip initial whitespace */
+ while (isspace(cmdstr[idx]))
+ idx++;
+
/* first part (if present) is an address: either a number or a /regex/ */
if (isdigit(cmdstr[idx]) || cmdstr[idx] == '/')
idx = get_address(sed_cmd, cmdstr, &sed_cmd->beg_line, &sed_cmd->beg_match);
if (cmdstr[idx] == ',')
idx += get_address(sed_cmd, &cmdstr[++idx], &sed_cmd->end_line, &sed_cmd->end_match);
+ /* skip whitespace before the command */
+ while (isspace(cmdstr[idx]))
+ idx++;
+
/* last part (mandatory) will be a command */
if (cmdstr[idx] == '\0')
error_msg_and_die("missing command");