Changed names of functions in utility.c and all affected files, to make
compliant with the style guide. Everybody rebuild your tags file!
diff --git a/editors/sed.c b/editors/sed.c
index f26e6e3..812f621 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -215,14 +215,14 @@
else if (my_str[idx] == '/') {
idx = index_of_next_unescaped_slash(my_str, ++idx);
if (idx == -1)
- fatalError("unterminated match expression\n");
+ error_msg_and_die("unterminated match expression\n");
my_str[idx] = '\0';
*regex = (regex_t *)xmalloc(sizeof(regex_t));
xregcomp(*regex, my_str+1, 0);
idx++; /* so it points to the next character after the last '/' */
}
else {
- errorMsg("get_address: no address found in string\n"
+ error_msg("get_address: no address found in string\n"
"\t(you probably didn't check the string you passed me)\n");
idx = -1;
}
@@ -258,13 +258,13 @@
/* verify that the 's' is followed by a 'slash' */
if (substr[++idx] != '/')
- fatalError("bad format in substitution expression\n");
+ error_msg_and_die("bad format in substitution expression\n");
/* save the match string */
oldidx = idx+1;
idx = index_of_next_unescaped_slash(substr, ++idx);
if (idx == -1)
- fatalError("bad format in substitution expression\n");
+ error_msg_and_die("bad format in substitution expression\n");
match = strdup_substr(substr, oldidx, idx);
/* determine the number of back references in the match string */
@@ -283,7 +283,7 @@
oldidx = idx+1;
idx = index_of_next_unescaped_slash(substr, ++idx);
if (idx == -1)
- fatalError("bad format in substitution expression\n");
+ error_msg_and_die("bad format in substitution expression\n");
sed_cmd->replace = strdup_substr(substr, oldidx, idx);
/* process the flags */
@@ -303,7 +303,7 @@
if (strchr("; \t\v\n\r", substr[idx]))
goto out;
/* else */
- fatalError("bad option in substitution expression\n");
+ error_msg_and_die("bad option in substitution expression\n");
}
}
@@ -345,7 +345,7 @@
*/
if (editstr[1] != '\\' && (editstr[2] != '\n' || editstr[2] != '\r'))
- fatalError("bad format in edit expression\n");
+ error_msg_and_die("bad format in edit expression\n");
/* store the edit line text */
/* make editline big enough to accomodate the extra '\n' we will tack on
@@ -409,9 +409,9 @@
/* last part (mandatory) will be a command */
if (cmdstr[idx] == '\0')
- fatalError("missing command\n");
+ error_msg_and_die("missing command\n");
if (!strchr("pdsaic", cmdstr[idx])) /* <-- XXX add new commands here */
- fatalError("invalid command\n");
+ error_msg_and_die("invalid command\n");
sed_cmd->cmd = cmdstr[idx];
/* special-case handling for (s)ubstitution */
@@ -421,7 +421,7 @@
/* 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)
- fatalError("only a beginning address can be specified for edit commands\n");
+ error_msg_and_die("only a beginning address can be specified for edit commands\n");
idx += parse_edit_cmd(sed_cmd, &cmdstr[idx]);
}
/* if it was a single-letter command (such as 'p' or 'd') we need to
@@ -757,7 +757,7 @@
for (i = optind; i < argc; i++) {
file = fopen(argv[i], "r");
if (file == NULL) {
- errorMsg("%s: %s\n", argv[i], strerror(errno));
+ error_msg("%s: %s\n", argv[i], strerror(errno));
} else {
process_file(file);
fclose(file);