diff --git a/bin/sh/Makefile b/bin/sh/Makefile index 4d8aaa18d38b..18a7e00967f0 100644 --- a/bin/sh/Makefile +++ b/bin/sh/Makefile @@ -1,8 +1,9 @@ -# $NetBSD: Makefile,v 1.78 2004/06/06 07:03:11 christos Exp $ +# $NetBSD: Makefile,v 1.79 2004/10/30 19:29:27 christos Exp $ # @(#)Makefile 8.4 (Berkeley) 5/5/95 .include +WARNS=3 YHEADER=1 PROG= sh SHSRCS= alias.c cd.c echo.c error.c eval.c exec.c expand.c \ diff --git a/bin/sh/eval.c b/bin/sh/eval.c index c6b3b936bd5d..79f036784292 100644 --- a/bin/sh/eval.c +++ b/bin/sh/eval.c @@ -1,4 +1,4 @@ -/* $NetBSD: eval.c,v 1.79 2004/06/30 09:32:38 mycroft Exp $ */ +/* $NetBSD: eval.c,v 1.80 2004/10/30 19:29:27 christos Exp $ */ /*- * Copyright (c) 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)eval.c 8.9 (Berkeley) 6/8/95"; #else -__RCSID("$NetBSD: eval.c,v 1.79 2004/06/30 09:32:38 mycroft Exp $"); +__RCSID("$NetBSD: eval.c,v 1.80 2004/10/30 19:29:27 christos Exp $"); #endif #endif /* not lint */ @@ -605,6 +605,7 @@ syspath(void) { static char *sys_path = NULL; static int mib[] = {CTL_USER, USER_CS_PATH}; + static char def_path[] = "PATH=/usr/bin:/bin:/usr/sbin:/sbin"; size_t len; if (sys_path == NULL) { @@ -615,7 +616,7 @@ syspath(void) } else { ckfree(sys_path); /* something to keep things happy */ - sys_path = "PATH=/usr/bin:/bin:/usr/sbin:/sbin"; + sys_path = def_path; } } return sys_path; diff --git a/bin/sh/options.c b/bin/sh/options.c index 6ac0aa58f548..0c6edcdf9f2a 100644 --- a/bin/sh/options.c +++ b/bin/sh/options.c @@ -1,4 +1,4 @@ -/* $NetBSD: options.c,v 1.36 2004/01/05 23:23:32 jmmv Exp $ */ +/* $NetBSD: options.c,v 1.37 2004/10/30 19:29:27 christos Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: options.c,v 1.36 2004/01/05 23:23:32 jmmv Exp $"); +__RCSID("$NetBSD: options.c,v 1.37 2004/10/30 19:29:27 christos Exp $"); #endif #endif /* not lint */ @@ -151,6 +151,7 @@ optschanged(void) STATIC void options(int cmdline) { + static char empty[] = ""; char *p; int val; int c; @@ -180,7 +181,8 @@ options(int cmdline) } while ((c = *p++) != '\0') { if (c == 'c' && cmdline) { - minusc = ""; /* command is after shell args*/ + /* command is after shell args*/ + minusc = empty; } else if (c == 'o') { minus_o(*argptr, val); if (*argptr)