summaryrefslogtreecommitdiffstats
path: root/bin/sh
diff options
context:
space:
mode:
authorcracauer <cracauer@FreeBSD.org>2000-04-20 09:49:16 +0000
committercracauer <cracauer@FreeBSD.org>2000-04-20 09:49:16 +0000
commit72606bd24b5a939819d9dadc84fc7ec891cff643 (patch)
tree077ee4ffbe0c4417f9d91cded1a1d7cc7b74be7a /bin/sh
parent582b546eb7cf75ea34c125f7893cf78079c7a160 (diff)
downloadFreeBSD-src-72606bd24b5a939819d9dadc84fc7ec891cff643.zip
FreeBSD-src-72606bd24b5a939819d9dadc84fc7ec891cff643.tar.gz
Fix warnings, some of them serious because sh violated name
spaces reserved by the header files it includes. mkinit.c still produces C code with redundant declarations, although they are more harmless since they automatically derived from the right places.
Diffstat (limited to 'bin/sh')
-rw-r--r--bin/sh/arith_lex.l1
-rw-r--r--bin/sh/error.h1
-rw-r--r--bin/sh/histedit.c4
-rw-r--r--bin/sh/jobs.c1
-rw-r--r--bin/sh/miscbltin.c9
-rw-r--r--bin/sh/options.c4
-rw-r--r--bin/sh/options.h2
-rw-r--r--bin/sh/parser.c3
8 files changed, 8 insertions, 17 deletions
diff --git a/bin/sh/arith_lex.l b/bin/sh/arith_lex.l
index 8b855bd..82086bf 100644
--- a/bin/sh/arith_lex.l
+++ b/bin/sh/arith_lex.l
@@ -45,7 +45,6 @@ static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
-#include <unistd.h>
#include "y.tab.h"
#include "error.h"
diff --git a/bin/sh/error.h b/bin/sh/error.h
index 6c58c12..b86e177 100644
--- a/bin/sh/error.h
+++ b/bin/sh/error.h
@@ -82,7 +82,6 @@ extern volatile sig_atomic_t exception;
extern volatile sig_atomic_t suppressint;
extern volatile sig_atomic_t intpending;
-extern char *commandname; /* name of command--printed on error */
#define INTOFF suppressint++
#define INTON { if (--suppressint == 0 && intpending) onint(); }
diff --git a/bin/sh/histedit.c b/bin/sh/histedit.c
index 798118b..6ff6070 100644
--- a/bin/sh/histedit.c
+++ b/bin/sh/histedit.c
@@ -168,8 +168,6 @@ histcmd(argc, argv)
int argc;
char **argv;
{
- extern char *optarg;
- extern int optind, optopt, optreset;
int ch;
char *editor = NULL;
const HistEvent *he;
@@ -210,7 +208,7 @@ histcmd(argc, argv)
(ch = getopt(argc, argv, ":e:lnrs")) != -1)
switch ((char)ch) {
case 'e':
- editor = optarg;
+ editor = shoptarg;
break;
case 'l':
lflg = 1;
diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c
index 72a7bd2..5e6b3e7 100644
--- a/bin/sh/jobs.c
+++ b/bin/sh/jobs.c
@@ -971,7 +971,6 @@ stoppedjobs()
STATIC char *cmdnextc;
STATIC int cmdnleft;
-STATIC void cmdtxt(), cmdputs();
#define MAXCMDTEXT 200
char *
diff --git a/bin/sh/miscbltin.c b/bin/sh/miscbltin.c
index bb602f6..46d3950 100644
--- a/bin/sh/miscbltin.c
+++ b/bin/sh/miscbltin.c
@@ -67,9 +67,6 @@ static const char rcsid[] =
#undef eflag
-extern char **argptr; /* argument list for builtin command */
-
-
/*
* The read builtin. The -r option causes backslashes to be treated like
* ordinary characters.
@@ -105,7 +102,7 @@ readcmd(argc, argv)
while ((i = nextopt("erp:t:")) != '\0') {
switch(i) {
case 'p':
- prompt = optarg;
+ prompt = shoptarg;
break;
case 'e':
break;
@@ -113,8 +110,8 @@ readcmd(argc, argv)
rflag = 1;
break;
case 't':
- tv.tv_sec = strtol(optarg, &tvptr, 0);
- if (tvptr == optarg)
+ tv.tv_sec = strtol(shoptarg, &tvptr, 0);
+ if (tvptr == shoptarg)
error("timeout value");
switch(*tvptr) {
case 0:
diff --git a/bin/sh/options.c b/bin/sh/options.c
index 2bd55f5..36f9c5c 100644
--- a/bin/sh/options.c
+++ b/bin/sh/options.c
@@ -67,7 +67,7 @@ static const char rcsid[] =
char *arg0; /* value of $0 */
struct shparam shellparam; /* current positional parameters */
char **argptr; /* argument list for builtin commands */
-char *optarg; /* set by nextopt (like getopt) */
+char *shoptarg; /* set by nextopt (like getopt) */
char *optptr; /* used by nextopt */
char *minusc; /* argument to -c option */
@@ -539,7 +539,7 @@ nextopt(optstring)
if (*++q == ':') {
if (*p == '\0' && (p = *argptr++) == NULL)
error("No arg for -%c option", c);
- optarg = p;
+ shoptarg = p;
p = NULL;
}
optptr = p;
diff --git a/bin/sh/options.h b/bin/sh/options.h
index e283703..023027b 100644
--- a/bin/sh/options.h
+++ b/bin/sh/options.h
@@ -103,7 +103,7 @@ extern char *minusc; /* argument to -c option */
extern char *arg0; /* $0 */
extern struct shparam shellparam; /* $@ */
extern char **argptr; /* argument list for builtin commands */
-extern char *optarg; /* set by nextopt */
+extern char *shoptarg; /* set by nextopt */
extern char *optptr; /* used by nextopt */
void procargs __P((int, char **));
diff --git a/bin/sh/parser.c b/bin/sh/parser.c
index 2aa2665..9b141cc 100644
--- a/bin/sh/parser.c
+++ b/bin/sh/parser.c
@@ -59,6 +59,7 @@ static const char rcsid[] =
#include "mystring.h"
#include "alias.h"
#include "show.h"
+#include "eval.h"
#ifndef NO_HISTORY
#include "myhistedit.h"
#endif
@@ -678,8 +679,6 @@ peektoken() {
return (t);
}
-STATIC int xxreadtoken();
-
STATIC int
readtoken() {
int t;
OpenPOWER on IntegriCloud