From 846dce0ee3e2367831b30b2449654daae602c582 Mon Sep 17 00:00:00 2001 From: christos Date: Sat, 2 Nov 1996 18:26:03 +0000 Subject: [PATCH] Fix problems that gcc -Wall found (from Todd Miller, OpenBSD) --- bin/sh/bltin/echo.c | 3 ++- bin/sh/input.c | 5 ++--- bin/sh/jobs.c | 6 +++--- bin/sh/options.c | 6 +++--- bin/sh/var.h | 3 ++- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/bin/sh/bltin/echo.c b/bin/sh/bltin/echo.c index 2a9edb11978b..726346ea32d2 100644 --- a/bin/sh/bltin/echo.c +++ b/bin/sh/bltin/echo.c @@ -1,4 +1,4 @@ -/* $NetBSD: echo.c,v 1.7 1995/03/21 09:10:49 cgd Exp $ */ +/* $NetBSD: echo.c,v 1.8 1996/11/02 18:26:06 christos Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -48,6 +48,7 @@ /* #define eflag 1 */ +int main(argc, argv) char **argv; { register char **ap; register char *p; diff --git a/bin/sh/input.c b/bin/sh/input.c index f71ecc9214ea..fdc01c878210 100644 --- a/bin/sh/input.c +++ b/bin/sh/input.c @@ -1,4 +1,4 @@ -/* $NetBSD: input.c,v 1.20 1996/10/16 15:45:08 christos Exp $ */ +/* $NetBSD: input.c,v 1.21 1996/11/02 18:26:03 christos Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -40,7 +40,7 @@ #if 0 static char sccsid[] = "@(#)input.c 8.3 (Berkeley) 6/9/95"; #else -static char rcsid[] = "$NetBSD: input.c,v 1.20 1996/10/16 15:45:08 christos Exp $"; +static char rcsid[] = "$NetBSD: input.c,v 1.21 1996/11/02 18:26:03 christos Exp $"; #endif #endif /* not lint */ @@ -185,7 +185,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 72b7d0f926af..04a79cb9c7e1 100644 --- a/bin/sh/jobs.c +++ b/bin/sh/jobs.c @@ -1,4 +1,4 @@ -/* $NetBSD: jobs.c,v 1.19 1996/10/16 14:42:20 christos Exp $ */ +/* $NetBSD: jobs.c,v 1.20 1996/11/02 18:26:04 christos Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -40,7 +40,7 @@ #if 0 static char sccsid[] = "@(#)jobs.c 8.5 (Berkeley) 5/4/95"; #else -static char rcsid[] = "$NetBSD: jobs.c,v 1.19 1996/10/16 14:42:20 christos Exp $"; +static char rcsid[] = "$NetBSD: jobs.c,v 1.20 1996/11/02 18:26:04 christos Exp $"; #endif #endif /* not lint */ @@ -1100,7 +1100,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 1f0e92f0d653..a1487f7e0764 100644 --- a/bin/sh/options.c +++ b/bin/sh/options.c @@ -1,4 +1,4 @@ -/* $NetBSD: options.c,v 1.17 1996/10/16 14:49:56 christos Exp $ */ +/* $NetBSD: options.c,v 1.18 1996/11/02 18:26:05 christos Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -40,7 +40,7 @@ #if 0 static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 5/4/95"; #else -static char rcsid[] = "$NetBSD: options.c,v 1.17 1996/10/16 14:49:56 christos Exp $"; +static char rcsid[] = "$NetBSD: options.c,v 1.18 1996/11/02 18:26:05 christos Exp $"; #endif #endif /* not lint */ @@ -361,7 +361,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 00a566672f8b..b1314aebf626 100644 --- a/bin/sh/var.h +++ b/bin/sh/var.h @@ -1,4 +1,4 @@ -/* $NetBSD: var.h,v 1.11 1996/10/16 15:45:21 christos Exp $ */ +/* $NetBSD: var.h,v 1.12 1996/11/02 18:26:05 christos Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -130,3 +130,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));