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): split local variable into two in Var_P...
details: https://anonhg.NetBSD.org/src/rev/a328212c6dba
branches: trunk
changeset: 936424:a328212c6dba
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Jul 26 19:13:42 2020 +0000
description:
make(1): split local variable into two in Var_Parse
diffstat:
usr.bin/make/var.c | 13 +++++--------
1 files changed, 5 insertions(+), 8 deletions(-)
diffs (54 lines):
diff -r 9e1dce7e4087 -r a328212c6dba usr.bin/make/var.c
--- a/usr.bin/make/var.c Sun Jul 26 19:11:06 2020 +0000
+++ b/usr.bin/make/var.c Sun Jul 26 19:13:42 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: var.c,v 1.325 2020/07/26 19:11:06 rillig Exp $ */
+/* $NetBSD: var.c,v 1.326 2020/07/26 19:13:42 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.325 2020/07/26 19:11:06 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.326 2020/07/26 19:13:42 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.325 2020/07/26 19:11:06 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.326 2020/07/26 19:13:42 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -3401,7 +3401,6 @@
* is done to support dynamic sources. The
* result is just the invocation, unaltered */
const char *extramodifiers; /* extra modifiers to apply first */
- char name[2];
*freePtr = NULL;
extramodifiers = NULL;
@@ -3421,8 +3420,7 @@
*lengthPtr = 1;
return var_Error;
}
- name[0] = startc;
- name[1] = '\0';
+ char name[] = { startc, '\0' };
v = VarFind(name, ctxt, FIND_ENV | FIND_GLOBAL | FIND_CMD);
if (v == NULL) {
@@ -3526,8 +3524,7 @@
/*
* Well, it's local -- go look for it.
*/
- name[0] = varname[0];
- name[1] = '\0';
+ char name[] = {varname[0], '\0' };
v = VarFind(name, ctxt, 0);
if (v != NULL) {
Home |
Main Index |
Thread Index |
Old Index