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): use char literals, improve documentation
details: https://anonhg.NetBSD.org/src/rev/2fb8df3f7195
branches: trunk
changeset: 937135:2fb8df3f7195
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Aug 09 14:30:35 2020 +0000
description:
make(1): use char literals, improve documentation
diffstat:
usr.bin/make/var.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diffs (61 lines):
diff -r 4a4b6ce38584 -r 2fb8df3f7195 usr.bin/make/var.c
--- a/usr.bin/make/var.c Sun Aug 09 14:02:15 2020 +0000
+++ b/usr.bin/make/var.c Sun Aug 09 14:30:35 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: var.c,v 1.443 2020/08/09 14:02:15 rillig Exp $ */
+/* $NetBSD: var.c,v 1.444 2020/08/09 14:30:35 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.443 2020/08/09 14:02:15 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.444 2020/08/09 14:30: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.443 2020/08/09 14:02:15 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.444 2020/08/09 14:30:35 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -1933,7 +1933,8 @@
* to the expression */
char missing_delim; /* For error reporting */
- Byte sep; /* Word separator in expansions */
+ Byte sep; /* Word separator in expansions
+ * (see the :ts modifier) */
Boolean oneBigWord; /* TRUE if the variable value is treated as a
* single big word, even if it contains
* embedded spaces (as opposed to the
@@ -2991,13 +2992,12 @@
#endif
/* Apply any modifiers (such as :Mpattern or :@var@loop@ or :Q or ::=value). */
-
static char *
ApplyModifiers(
const char **pp, /* the parsing position, updated upon return */
char *val, /* the current value of the variable */
- char const startc, /* '(' or '{' or '\0' */
- char const endc, /* ')' or '}' or '\0' */
+ char const startc, /* '(' or '{', or '\0' for indirect modifiers */
+ char const endc, /* ')' or '}', or '\0' for indirect modifiers */
Var * const v, /* the variable may have its flags changed */
GNode * const ctxt, /* for looking up and modifying variables */
VarEvalFlags const eflags,
@@ -3045,7 +3045,7 @@
if (rval != NULL && *rval) {
const char *rval_pp = rval;
- st.val = ApplyModifiers(&rval_pp, st.val, 0, 0, v,
+ st.val = ApplyModifiers(&rval_pp, st.val, '\0', '\0', v,
ctxt, eflags, freePtr);
if (st.val == var_Error
|| (st.val == varNoError && !(st.eflags & VARE_UNDEFERR))
Home |
Main Index |
Thread Index |
Old Index