Module Name:    src
Committed By:   rillig
Date:           Sat Oct  3 10:13:39 UTC 2020

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

Log Message:
make(1): clean up confusing code in Var_Export

The generated code stays exactly the same.


To generate a diff of this commit:
cvs rdiff -u -r1.556 -r1.557 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.556 src/usr.bin/make/var.c:1.557
--- src/usr.bin/make/var.c:1.556	Fri Oct  2 17:42:33 2020
+++ src/usr.bin/make/var.c	Sat Oct  3 10:13:39 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.556 2020/10/02 17:42:33 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.557 2020/10/03 10:13:39 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -121,7 +121,7 @@
 #include    "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.556 2020/10/02 17:42:33 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.557 2020/10/03 10:13:39 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -601,14 +601,14 @@ Var_Export(const char *str, Boolean isEx
 	return;
     }
 
-    flags = 0;
     if (strncmp(str, "-env", 4) == 0) {
 	str += 4;
+    	flags = 0;
     } else if (strncmp(str, "-literal", 8) == 0) {
 	str += 8;
-	flags |= VAR_EXPORT_LITERAL;
+	flags = VAR_EXPORT_LITERAL;
     } else {
-	flags |= VAR_EXPORT_PARENT;
+	flags = VAR_EXPORT_PARENT;
     }
 
     (void)Var_Subst(str, VAR_GLOBAL, VARE_WANTRES, &val);

Reply via email to