aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 8b855bd78121..82086bfbaced 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 6c58c123373d..b86e17799474 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 798118b90a61..6ff6070a4647 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 72a7bd2bf574..5e6b3e7e7f0f 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 bb602f6a68af..46d39502111d 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 2bd55f5030e7..36f9c5c05d39 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 e28370364df7..023027be5ae8 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 2aa2665e0159..9b141ccb4413 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;