Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/make make(1): clean up Var_Export
details: https://anonhg.NetBSD.org/src/rev/a32c754a6078
branches: trunk
changeset: 974118:a32c754a6078
user: rillig <rillig%NetBSD.org@localhost>
date: Fri Jul 24 07:59:35 2020 +0000
description:
make(1): clean up Var_Export
diffstat:
usr.bin/make/var.c | 17 ++++++++---------
1 files changed, 8 insertions(+), 9 deletions(-)
diffs (63 lines):
diff -r ecacf7d3ee16 -r a32c754a6078 usr.bin/make/var.c
--- a/usr.bin/make/var.c Fri Jul 24 07:52:44 2020 +0000
+++ b/usr.bin/make/var.c Fri Jul 24 07:59:35 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: var.c,v 1.301 2020/07/24 07:52:44 rillig Exp $ */
+/* $NetBSD: var.c,v 1.302 2020/07/24 07:59:35 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.301 2020/07/24 07:52:44 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.302 2020/07/24 07:59:35 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.301 2020/07/24 07:52:44 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.302 2020/07/24 07:59:35 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -634,11 +634,9 @@
void
Var_Export(char *str, int isExport)
{
- char *name;
- char *val;
char **av;
char *as;
- int flags;
+ VarExportFlags flags;
int ac;
int i;
@@ -656,11 +654,12 @@
} else {
flags |= VAR_EXPORT_PARENT;
}
- val = Var_Subst(NULL, str, VAR_GLOBAL, VARE_WANTRES);
+
+ char *val = Var_Subst(NULL, str, VAR_GLOBAL, VARE_WANTRES);
if (*val) {
av = brk_string(val, &ac, FALSE, &as);
for (i = 0; i < ac; i++) {
- name = av[i];
+ const char *name = av[i];
if (!name[1]) {
/*
* A single char.
@@ -2151,7 +2150,7 @@
neflags = st->eflags;
/*
- * Pass through tstr looking for 1) escaped delimiters,
+ * Pass through mod looking for 1) escaped delimiters,
* '$'s and backslashes (place the escaped character in
* uninterpreted) and 2) unescaped $'s that aren't before
* the delimiter (expand the variable substitution).
Home |
Main Index |
Thread Index |
Old Index