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/shell/lash.c b/shell/lash.c
index bb8a456..4b1ae6d 100644
--- a/shell/lash.c
+++ b/shell/lash.c
@@ -250,7 +250,7 @@
{
cmd->progs[0].argv++;
execvp(cmd->progs[0].argv[0], cmd->progs[0].argv);
- fatalError("Exec to %s failed: %s\n", cmd->progs[0].argv[0],
+ error_msg_and_die("Exec to %s failed: %s\n", cmd->progs[0].argv[0],
strerror(errno));
}
return EXIT_SUCCESS;
@@ -273,12 +273,12 @@
if (!jobList->head) {
if (!cmd->progs[0].argv[1] || cmd->progs[0].argv[2]) {
- errorMsg("%s: exactly one argument is expected\n",
+ error_msg("%s: exactly one argument is expected\n",
cmd->progs[0].argv[0]);
return EXIT_FAILURE;
}
if (sscanf(cmd->progs[0].argv[1], "%%%d", &jobNum) != 1) {
- errorMsg("%s: bad argument '%s'\n",
+ error_msg("%s: bad argument '%s'\n",
cmd->progs[0].argv[0], cmd->progs[0].argv[1]);
return EXIT_FAILURE;
for (job = jobList->head; job; job = job->next) {
@@ -292,7 +292,7 @@
}
if (!job) {
- errorMsg("%s: unknown job %d\n",
+ error_msg("%s: unknown job %d\n",
cmd->progs[0].argv[0], jobNum);
return EXIT_FAILURE;
}
@@ -444,7 +444,7 @@
char* charptr1=cmd->text+5; /* skip over the leading 'then ' */
if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) {
- errorMsg("unexpected token `then'\n");
+ error_msg("unexpected token `then'\n");
return EXIT_FAILURE;
}
/* If the if result was FALSE, skip the 'then' stuff */
@@ -471,7 +471,7 @@
char* charptr1=cmd->text+5; /* skip over the leading 'else ' */
if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) {
- errorMsg("unexpected token `else'\n");
+ error_msg("unexpected token `else'\n");
return EXIT_FAILURE;
}
/* If the if result was TRUE, skip the 'else' stuff */
@@ -495,7 +495,7 @@
static int builtin_fi(struct job *cmd, struct jobSet *junk)
{
if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) {
- errorMsg("unexpected token `fi'\n");
+ error_msg("unexpected token `fi'\n");
return EXIT_FAILURE;
}
/* Clear out the if and then context bits */
@@ -646,7 +646,7 @@
if (openfd < 0) {
/* this could get lost if stderr has been redirected, but
bash and ash both lose it as well (though zsh doesn't!) */
- errorMsg("error opening %s: %s\n", redir->filename,
+ error_msg("error opening %s: %s\n", redir->filename,
strerror(errno));
return 1;
}
@@ -820,7 +820,7 @@
if (strpbrk(prog->argv[argc_l - 1],"*[]?")!= NULL){
rc = glob(prog->argv[argc_l - 1], flags, NULL, &prog->globResult);
if (rc == GLOB_NOSPACE) {
- errorMsg("out of space during glob operation\n");
+ error_msg("out of space during glob operation\n");
return;
} else if (rc == GLOB_NOMATCH ||
(!rc && (prog->globResult.gl_pathc - i) == 1 &&
@@ -927,7 +927,7 @@
if (*src == '\\') {
src++;
if (!*src) {
- errorMsg("character expected after \\\n");
+ error_msg("character expected after \\\n");
freeJob(job);
return 1;
}
@@ -1009,7 +1009,7 @@
chptr++;
if (!*chptr) {
- errorMsg("file name expected after %c\n", *src);
+ error_msg("file name expected after %c\n", *src);
freeJob(job);
job->numProgs=0;
return 1;
@@ -1028,7 +1028,7 @@
if (*prog->argv[argc_l])
argc_l++;
if (!argc_l) {
- errorMsg("empty command in pipe\n");
+ error_msg("empty command in pipe\n");
freeJob(job);
job->numProgs=0;
return 1;
@@ -1055,7 +1055,7 @@
src++;
if (!*src) {
- errorMsg("empty command in pipe\n");
+ error_msg("empty command in pipe\n");
freeJob(job);
job->numProgs=0;
return 1;
@@ -1114,7 +1114,7 @@
* command line, making extra room as needed */
--src;
charptr1 = xmalloc(BUFSIZ);
- while ( (size=fullRead(pipefd[0], charptr1, BUFSIZ-1)) >0) {
+ while ( (size=full_read(pipefd[0], charptr1, BUFSIZ-1)) >0) {
int newSize=src - *commandPtr + size + 1 + strlen(charptr2);
if (newSize > BUFSIZ) {
*commandPtr=xrealloc(*commandPtr, src - *commandPtr +
@@ -1145,7 +1145,7 @@
case '\\':
src++;
if (!*src) {
- errorMsg("character expected after \\\n");
+ error_msg("character expected after \\\n");
freeJob(job);
return 1;
}
@@ -1291,7 +1291,7 @@
#endif
execvp(newJob->progs[i].argv[0], newJob->progs[i].argv);
- fatalError("%s: %s\n", newJob->progs[i].argv[0],
+ error_msg_and_die("%s: %s\n", newJob->progs[i].argv[0],
strerror(errno));
}
if (outPipe[1]!=-1) {
@@ -1495,7 +1495,7 @@
case 'c':
input = NULL;
if (local_pending_command != 0)
- fatalError("multiple -c arguments\n");
+ error_msg_and_die("multiple -c arguments\n");
local_pending_command = xstrdup(argv[optind]);
optind++;
argv = argv+optind;