improve of cmpl.
[bush.git] / CWRU / misc / errlist.c
blob2ed8a0aca29560522baba4e5502ba51a4ed77049
1 /*
2 * If necessary, link with lib/sh/libsh.a
3 */
5 /* Copyright (C) 1998-2009 Free Software Foundation, Inc.
7 This file is part of GNU Bush, the Bourne Again SHell.
9 Bush is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 Bush is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with Bush. If not, see <http://www.gnu.org/licenses/>.
23 #include <stdio.h>
24 #include <errno.h>
26 extern char *strerror();
28 extern int sys_nerr;
30 int
31 main(c, v)
32 int c;
33 char **v;
35 int i, n;
37 if (c == 1) {
38 for (i = 1; i < sys_nerr; i++)
39 printf("%d --> %s\n", i, strerror(i));
40 } else {
41 for (i = 1; i < c; i++) {
42 n = atoi(v[i]);
43 printf("%d --> %s\n", n, strerror(n));
46 exit (0);
49 programming_error(a, b)
50 char *a;
51 int b;
55 fatal_error()