Module Name: src
Committed By: rillig
Date: Mon Jul 27 19:59:59 UTC 2020
Modified Files:
src/usr.bin/make: var.c
Log Message:
make(1): remove unnecessary argument validation
To generate a diff of this commit:
cvs rdiff -u -r1.337 -r1.338 src/usr.bin/make/var.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.337 src/usr.bin/make/var.c:1.338
--- src/usr.bin/make/var.c:1.337 Mon Jul 27 17:41:09 2020
+++ src/usr.bin/make/var.c Mon Jul 27 19:59:59 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: var.c,v 1.337 2020/07/27 17:41:09 rillig Exp $ */
+/* $NetBSD: var.c,v 1.338 2020/07/27 19:59:59 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.337 2020/07/27 17:41:09 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.338 2020/07/27 19:59:59 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: var.c,v 1.337 2020/07/27 17:41:09 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.338 2020/07/27 19:59:59 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -690,6 +690,8 @@ extern char **environ;
/*
* This is called when .unexport[-env] is seen.
+ *
+ * str must have the form "unexport[-env] varname...".
*/
void
Var_UnExport(char *str)
@@ -700,12 +702,9 @@ Var_UnExport(char *str)
Boolean unexport_env;
int n;
- if (str == NULL || str[0] == '\0')
- return; /* assert? */
-
vlist = NULL;
- str += 8;
+ str += strlen("unexport");
unexport_env = (strncmp(str, "-env", 4) == 0);
if (unexport_env) {
char **newenv;