summaryrefslogtreecommitdiff
path: root/usr.bin/make/cond.c
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>1999-12-09 18:18:25 +0000
committerMarc Espie <espie@cvs.openbsd.org>1999-12-09 18:18:25 +0000
commitd9223f1d8df224b1ed3755c095dd99fd859077d2 (patch)
tree5d804373f1365a45cddaee1468bbaa8c8ae1be74 /usr.bin/make/cond.c
parent046c3d1156d795ac61465e04ca8b44a3c0744870 (diff)
Introduce `common usage' buf patterns and use them.
Diffstat (limited to 'usr.bin/make/cond.c')
-rw-r--r--usr.bin/make/cond.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/usr.bin/make/cond.c b/usr.bin/make/cond.c
index 436ab50c8f0..562e6b73d8d 100644
--- a/usr.bin/make/cond.c
+++ b/usr.bin/make/cond.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cond.c,v 1.6 1999/12/06 22:28:44 espie Exp $ */
+/* $OpenBSD: cond.c,v 1.7 1999/12/09 18:18:24 espie Exp $ */
/* $NetBSD: cond.c,v 1.7 1996/11/06 17:59:02 christos Exp $ */
/*
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)cond.c 8.2 (Berkeley) 1/2/94";
#else
-static char rcsid[] = "$OpenBSD: cond.c,v 1.6 1999/12/06 22:28:44 espie Exp $";
+static char rcsid[] = "$OpenBSD: cond.c,v 1.7 1999/12/09 18:18:24 espie Exp $";
#endif
#endif /* not lint */
@@ -234,7 +234,7 @@ CondGetArg(linePtr, argPtr, func, parens)
cp2 = Var_Parse(cp, VAR_CMD, TRUE, &len, &doFree);
- Buf_AddChars(buf, strlen(cp2), cp2);
+ Buf_AddString(buf, cp2);
if (doFree) {
free(cp2);
}
@@ -543,12 +543,10 @@ CondToken(doEval)
if (!isspace((unsigned char) *condExpr) &&
strchr("!=><", *condExpr) == NULL) {
Buffer buf;
- char *cp;
buf = Buf_Init(0);
- for (cp = lhs; *cp; cp++)
- Buf_AddChar(buf, *cp);
+ Buf_AddString(buf, lhs);
if (doFree)
free(lhs);
@@ -640,7 +638,7 @@ do_string_compare:
cp2 = Var_Parse(cp, VAR_CMD, doEval,&len, &freeIt);
if (cp2 != var_Error) {
- Buf_AddChars(buf, strlen(cp2), cp2);
+ Buf_AddString(buf, cp2);
if (freeIt) {
free(cp2);
}