- * Copyright (C) 1999,2000 by Lineo, inc.
- * Written by Mark Whitley <markw@lineo.com>, <markw@enol.com>
+ * Copyright (C) 1999,2000,2001 by Lineo, inc.
+ * Written by Mark Whitley <markw@lineo.com>, <markw@codepoet.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
else if (my_str[idx] == '/') {
idx = index_of_next_unescaped_regexp_delim(sed_cmd, my_str, ++idx);
if (idx == -1)
else if (my_str[idx] == '/') {
idx = index_of_next_unescaped_regexp_delim(sed_cmd, my_str, ++idx);
if (idx == -1)
my_str[idx] = '\0';
*regex = (regex_t *)xmalloc(sizeof(regex_t));
xregcomp(*regex, my_str+1, 0);
my_str[idx] = '\0';
*regex = (regex_t *)xmalloc(sizeof(regex_t));
xregcomp(*regex, my_str+1, 0);
/* verify that the 's' is followed by something. That something
* (typically a 'slash') is now our regexp delimiter... */
if (!substr[++idx])
/* verify that the 's' is followed by something. That something
* (typically a 'slash') is now our regexp delimiter... */
if (!substr[++idx])
match = strdup_substr(substr, oldidx, idx);
/* determine the number of back references in the match string */
match = strdup_substr(substr, oldidx, idx);
/* determine the number of back references in the match string */
/* store the edit line text */
/* make editline big enough to accomodate the extra '\n' we will tack on
/* store the edit line text */
/* make editline big enough to accomodate the extra '\n' we will tack on
/* special-case handling for (a)ppend, (i)nsert, and (c)hange */
else if (strchr("aic", cmdstr[idx])) {
if (sed_cmd->end_line || sed_cmd->end_match)
/* special-case handling for (a)ppend, (i)nsert, and (c)hange */
else if (strchr("aic", cmdstr[idx])) {
if (sed_cmd->end_line || sed_cmd->end_match)
idx += parse_edit_cmd(sed_cmd, &cmdstr[idx]);
}
/* if it was a single-letter command (such as 'p' or 'd') we need to
idx += parse_edit_cmd(sed_cmd, &cmdstr[idx]);
}
/* if it was a single-letter command (such as 'p' or 'd') we need to
}
/* eat trailing newline (if any) --if I don't do this, edit commands
* (aic) will print an extra newline */
}
/* eat trailing newline (if any) --if I don't do this, edit commands
* (aic) will print an extra newline */
* argv[optind] should be the pattern. no pattern, no worky */
if (ncmds == 0) {
if (argv[optind] == NULL)
* argv[optind] should be the pattern. no pattern, no worky */
if (ncmds == 0) {
if (argv[optind] == NULL)