Module Name:    src
Committed By:   rillig
Date:           Sat Aug  1 07:14:04 UTC 2020

Modified Files:
        src/usr.bin/make: var.c

Log Message:
make(1): make condition in Var_Export1 simpler to read


To generate a diff of this commit:
cvs rdiff -u -r1.371 -r1.372 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.371 src/usr.bin/make/var.c:1.372
--- src/usr.bin/make/var.c:1.371	Sat Aug  1 07:10:37 2020
+++ src/usr.bin/make/var.c	Sat Aug  1 07:14:04 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.371 2020/08/01 07:10:37 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.372 2020/08/01 07:14:04 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.371 2020/08/01 07:10:37 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.372 2020/08/01 07:14:04 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.371 2020/08/01 07:10:37 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.372 2020/08/01 07:14:04 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -524,10 +524,8 @@ Var_Export1(const char *name, VarExportF
     v = VarFind(name, VAR_GLOBAL, 0);
     if (v == NULL)
 	return 0;
-    if (!parent &&
-	(v->flags & (VAR_EXPORTED | VAR_REEXPORT)) == VAR_EXPORTED) {
-	return 0;			/* nothing to do */
-    }
+    if (!parent && (v->flags & VAR_EXPORTED) && !(v->flags & VAR_REEXPORT))
+	return 0;		/* nothing to do */
     val = Buf_GetAll(&v->val, NULL);
     if (!(flags & VAR_EXPORT_LITERAL) && strchr(val, '$')) {
 	if (parent) {

Reply via email to