summaryrefslogtreecommitdiff
path: root/usr.bin/make/varmodifiers.c
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2016-10-02 17:42:32 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2016-10-02 17:42:32 +0000
commite2e68a301f2e4c3117bde6fefec46090196ef00c (patch)
tree8467c2c97adffd8ac68fdda1272126979d4025a2 /usr.bin/make/varmodifiers.c
parente29051a72a7deb7f4661a701fadfcca955b0c487 (diff)
Avoid two printf("%s", NULL) with 'make -d v'.
improvements & ok espie, earlier version ok deraadt
Diffstat (limited to 'usr.bin/make/varmodifiers.c')
-rw-r--r--usr.bin/make/varmodifiers.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.bin/make/varmodifiers.c b/usr.bin/make/varmodifiers.c
index a9f8913d791..c8f8b99bc72 100644
--- a/usr.bin/make/varmodifiers.c
+++ b/usr.bin/make/varmodifiers.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: varmodifiers.c,v 1.43 2015/11/15 06:19:22 daniel Exp $ */
+/* $OpenBSD: varmodifiers.c,v 1.44 2016/10/02 17:42:31 tb Exp $ */
/* $NetBSD: var.c,v 1.18 1997/03/18 19:24:46 christos Exp $ */
/*
@@ -1452,8 +1452,12 @@ VarModifiers_Apply(char *str, const struct Name *name, SymTable *ctxt,
char *newStr;
tstr++;
- if (DEBUG(VAR))
- printf("Applying :%c to \"%s\"\n", *tstr, str);
+ if (DEBUG(VAR)) {
+ if (str != NULL)
+ printf("Applying :%c to \"%s\"\n", *tstr, str);
+ else
+ printf("Applying :%c\n", *tstr);
+ }
mod = choose_mod[(unsigned char)*tstr];
arg = NULL;
@@ -1501,7 +1505,7 @@ VarModifiers_Apply(char *str, const struct Name *name, SymTable *ctxt,
*freePtr = false;
break;
}
- if (DEBUG(VAR))
+ if (DEBUG(VAR) && str != NULL)
printf("Result is \"%s\"\n", str);
}
if (*tstr == '\0')