diff options
author | Jari Aalto <jari.aalto@cante.net> | 1999-02-19 17:11:39 +0000 |
---|---|---|
committer | Jari Aalto <jari.aalto@cante.net> | 2009-09-12 16:46:52 +0000 |
commit | b72432fdcc59300c6fe7c9d6c8a31ad3447933f5 (patch) | |
tree | b9899162338c2ff3fd83a8aef8831cb119e85cd7 /error.c | |
parent | bc4cd23ce958feda898c618215f94d8a4e8f4ffa (diff) | |
download | bash-b72432fdcc59300c6fe7c9d6c8a31ad3447933f5.tar.gz |
Imported from ../bash-2.03.tar.gz.
Diffstat (limited to 'error.c')
-rw-r--r-- | error.c | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -496,3 +496,32 @@ trace (format, va_alist) #endif /* 0 */ #endif /* USE_VARARGS */ + +static char *cmd_error_table[] = { + "unknown command error", /* CMDERR_DEFAULT */ + "bad command type", /* CMDERR_BADTYPE */ + "bad connector", /* CMDERR_BADCONN */ + "bad jump", /* CMDERR_BADJUMP */ + 0 +}; + +void +command_error (func, code, e, flags) + const char *func; + int code, e, flags; /* flags currently unused */ +{ + if (code > CMDERR_LAST) + code = CMDERR_DEFAULT; + + programming_error ("%s: %s: %d", func, cmd_error_table[code], e); +} + +char * +command_errstr (code) + int code; +{ + if (code > CMDERR_LAST) + code = CMDERR_DEFAULT; + + return (cmd_error_table[code]); +} |