diff options
Diffstat (limited to '')
-rw-r--r-- | sh/parser.c | 4 | ||||
-rw-r--r-- | sh/sh.c | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/sh/parser.c b/sh/parser.c index 7e0a273..47edef2 100644 --- a/sh/parser.c +++ b/sh/parser.c @@ -71,8 +71,8 @@ int parseCommand(int argc, char *argv[]) { err = WEXITSTATUS(status_code); if (err == E2BIG || err == EACCES || err == EINVAL || err == ELOOP || err == ENAMETOOLONG || err == ENOENT || err == ENOTDIR) - return err; - return 0; + printf("sh: %s: %s", argv[0], strerror(err)); + return err; } /* USAGE @@ -121,8 +121,7 @@ void commandLoop(FILE *filstr) { if ((token = strtok_r(name, ";", &tokenstate)) != NULL) { for (; token != NULL;) { command_argc = splitCommand(token, command); /* See parser.c */ - if ((errno = parseCommand(command_argc, command)) != 0 /* See parser.c */ ) - printf("sh: %s: %s\n", command[0], strerror(errno)); + parseCommand(command_argc, command); /* See parser.c */ token = strtok_r(NULL, ";", &tokenstate); } } |