diff options
author | tjr <tjr@FreeBSD.org> | 2002-07-25 10:47:38 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2002-07-25 10:47:38 +0000 |
commit | ca8e9f2edf22b507593fe9c0b5a2b8f9fad7d37e (patch) | |
tree | 5018303a2ea7f396a38480e2e723c454ffc130c1 | |
parent | 3be089e932919830a7affb5dff5e8751a597e10b (diff) | |
download | FreeBSD-src-ca8e9f2edf22b507593fe9c0b5a2b8f9fad7d37e.zip FreeBSD-src-ca8e9f2edf22b507593fe9c0b5a2b8f9fad7d37e.tar.gz |
Set opterr to zero to avoid duplicate warnings from getopt(3) for unknown
options.
-rw-r--r-- | bin/sh/cd.c | 4 | ||||
-rw-r--r-- | bin/sh/eval.c | 1 | ||||
-rw-r--r-- | bin/sh/histedit.c | 1 | ||||
-rw-r--r-- | bin/sh/jobs.c | 1 | ||||
-rw-r--r-- | bin/sh/var.c | 1 |
5 files changed, 6 insertions, 2 deletions
diff --git a/bin/sh/cd.c b/bin/sh/cd.c index 39b466f..cf46a02 100644 --- a/bin/sh/cd.c +++ b/bin/sh/cd.c @@ -87,7 +87,7 @@ cdcmd(int argc, char **argv) struct stat statb; int ch, phys, print = 0; - optreset = 1; optind = 1; /* initialize getopt */ + optreset = 1; optind = 1; opterr = 0; /* initialize getopt */ phys = 0; while ((ch = getopt(argc, argv, "LP")) != -1) { switch (ch) { @@ -323,7 +323,7 @@ pwdcmd(int argc, char **argv) char buf[PATH_MAX]; int ch, phys; - optreset = 1; optind = 1; /* initialize getopt */ + optreset = 1; optind = 1; opterr = 0; /* initialize getopt */ phys = 0; while ((ch = getopt(argc, argv, "LP")) != -1) { switch (ch) { diff --git a/bin/sh/eval.c b/bin/sh/eval.c index 4e1079b..e147e43 100644 --- a/bin/sh/eval.c +++ b/bin/sh/eval.c @@ -1007,6 +1007,7 @@ commandcmd(int argc, char **argv) path = pathval(); optind = optreset = 1; + opterr = 0; while ((ch = getopt(argc, argv, "p")) != -1) { switch (ch) { case 'p': diff --git a/bin/sh/histedit.c b/bin/sh/histedit.c index 6cd9fe4..d081d05 100644 --- a/bin/sh/histedit.c +++ b/bin/sh/histedit.c @@ -208,6 +208,7 @@ histcmd(int argc, char **argv) error("missing history argument"); optreset = 1; optind = 1; /* initialize getopt */ + opterr = 0; while (not_fcnumber(argv[optind]) && (ch = getopt(argc, argv, ":e:lnrs")) != -1) switch ((char)ch) { diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c index 1cab468..db13855 100644 --- a/bin/sh/jobs.c +++ b/bin/sh/jobs.c @@ -259,6 +259,7 @@ jobscmd(int argc, char *argv[]) int ch, sformat, lformat; optind = optreset = 1; + opterr = 0; sformat = lformat = 0; while ((ch = getopt(argc, argv, "ls")) != -1) { switch (ch) { diff --git a/bin/sh/var.c b/bin/sh/var.c index a4241af..b3be70a 100644 --- a/bin/sh/var.c +++ b/bin/sh/var.c @@ -543,6 +543,7 @@ exportcmd(int argc, char **argv) cmdname = argv[0]; optreset = optind = 1; + opterr = 0; values = 0; while ((ch = getopt(argc, argv, "p")) != -1) { switch (ch) { |