summaryrefslogtreecommitdiffstats
path: root/bin/sh/cd.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/sh/cd.c')
-rw-r--r--bin/sh/cd.c4
1 files changed, 2 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) {
OpenPOWER on IntegriCloud