diff options
-rw-r--r-- | bin/sh/bltin/echo.c | 3 | ||||
-rw-r--r-- | bin/sh/expand.c | 7 | ||||
-rw-r--r-- | bin/sh/input.c | 5 | ||||
-rw-r--r-- | bin/sh/jobs.c | 6 | ||||
-rw-r--r-- | bin/sh/options.c | 6 | ||||
-rw-r--r-- | bin/sh/var.h | 3 |
6 files changed, 16 insertions, 14 deletions
diff --git a/bin/sh/bltin/echo.c b/bin/sh/bltin/echo.c index 31f3cc51ebe..993ececcb3e 100644 --- a/bin/sh/bltin/echo.c +++ b/bin/sh/bltin/echo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: echo.c,v 1.2 1996/06/23 14:21:41 deraadt Exp $ */ +/* $OpenBSD: echo.c,v 1.3 1996/11/02 05:18:29 millert Exp $ */ /* $NetBSD: echo.c,v 1.7 1995/03/21 09:10:49 cgd Exp $ */ /*- @@ -49,6 +49,7 @@ /* #define eflag 1 */ +int main(argc, argv) char **argv; { register char **ap; register char *p; diff --git a/bin/sh/expand.c b/bin/sh/expand.c index b42d4481903..0a2e4bdcffe 100644 --- a/bin/sh/expand.c +++ b/bin/sh/expand.c @@ -1,4 +1,4 @@ -/* $OpenBSD: expand.c,v 1.4 1996/10/20 00:54:49 millert Exp $ */ +/* $OpenBSD: expand.c,v 1.5 1996/11/02 05:18:24 millert Exp $ */ /* $NetBSD: expand.c,v 1.20 1996/02/12 15:11:41 christos Exp $ */ /*- @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)expand.c 8.5 (Berkeley) 5/15/95"; #else -static char rcsid[] = "$OpenBSD: expand.c,v 1.4 1996/10/20 00:54:49 millert Exp $"; +static char rcsid[] = "$OpenBSD: expand.c,v 1.5 1996/11/02 05:18:24 millert Exp $"; #endif #endif /* not lint */ @@ -705,9 +705,10 @@ varisset(name) } else if (is_digit(*name)) { int num = atoi(name); ap = shellparam.p; - while (--num > 0) + do { if (*ap++ == NULL) return 0; + } while (--num >= 0); } return 1; } diff --git a/bin/sh/input.c b/bin/sh/input.c index ad8eb2cc14c..f447c50aa3f 100644 --- a/bin/sh/input.c +++ b/bin/sh/input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: input.c,v 1.3 1996/06/23 14:21:16 deraadt Exp $ */ +/* $OpenBSD: input.c,v 1.4 1996/11/02 05:18:25 millert Exp $ */ /* $NetBSD: input.c,v 1.19 1995/10/19 04:14:37 christos Exp $ */ /*- @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)input.c 8.3 (Berkeley) 6/9/95"; #else -static char rcsid[] = "$OpenBSD: input.c,v 1.3 1996/06/23 14:21:16 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: input.c,v 1.4 1996/11/02 05:18:25 millert Exp $"; #endif #endif /* not lint */ @@ -186,7 +186,6 @@ pread() retry: if (parsefile->fd == 0 && el) { const char *rl_cp; - int len; rl_cp = el_gets(el, &nr); if (rl_cp == NULL) diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c index dbde5232ef1..4cdbbd89267 100644 --- a/bin/sh/jobs.c +++ b/bin/sh/jobs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: jobs.c,v 1.3 1996/10/20 00:54:51 millert Exp $ */ +/* $OpenBSD: jobs.c,v 1.4 1996/11/02 05:18:26 millert Exp $ */ /* $NetBSD: jobs.c,v 1.17 1995/07/04 16:26:45 pk Exp $ */ /*- @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)jobs.c 8.5 (Berkeley) 5/4/95"; #else -static char rcsid[] = "$OpenBSD: jobs.c,v 1.3 1996/10/20 00:54:51 millert Exp $"; +static char rcsid[] = "$OpenBSD: jobs.c,v 1.4 1996/11/02 05:18:26 millert Exp $"; #endif #endif /* not lint */ @@ -1101,7 +1101,7 @@ cmdputs(s) subtype = 0; } else if (c == CTLENDVAR) { *q++ = '}'; - } else if (c == CTLBACKQ | c == CTLBACKQ+CTLQUOTE) + } else if (c == CTLBACKQ || c == CTLBACKQ+CTLQUOTE) cmdnleft++; /* ignore it */ else *q++ = c; diff --git a/bin/sh/options.c b/bin/sh/options.c index 506a8d3b361..93d00e8562d 100644 --- a/bin/sh/options.c +++ b/bin/sh/options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: options.c,v 1.3 1996/10/20 00:54:59 millert Exp $ */ +/* $OpenBSD: options.c,v 1.4 1996/11/02 05:18:27 millert Exp $ */ /* $NetBSD: options.c,v 1.14 1995/05/11 21:29:46 christos Exp $ */ /*- @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 5/4/95"; #else -static char rcsid[] = "$OpenBSD: options.c,v 1.3 1996/10/20 00:54:59 millert Exp $"; +static char rcsid[] = "$OpenBSD: options.c,v 1.4 1996/11/02 05:18:27 millert Exp $"; #endif #endif /* not lint */ @@ -362,7 +362,7 @@ getoptsreset(value) const char *value; { if (number(value) == 1) - shellparam.optnext; + shellparam.optnext = NULL; } diff --git a/bin/sh/var.h b/bin/sh/var.h index 00ed16c3983..6d6530ed127 100644 --- a/bin/sh/var.h +++ b/bin/sh/var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: var.h,v 1.3 1996/10/20 00:55:09 millert Exp $ */ +/* $OpenBSD: var.h,v 1.4 1996/11/02 05:18:28 millert Exp $ */ /* $NetBSD: var.h,v 1.9 1995/05/11 21:30:44 christos Exp $ */ /*- @@ -131,3 +131,4 @@ void poplocalvars __P((void)); int setvarcmd __P((int, char **)); int unsetcmd __P((int, char **)); int unsetvar __P((char *)); +int setvarsafe __P((char *, char *, int)); |