summaryrefslogtreecommitdiffstats
path: root/usr.bin/make/for.c
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2005-02-07 07:54:23 +0000
committerharti <harti@FreeBSD.org>2005-02-07 07:54:23 +0000
commit92a5e4fdd6e689f9a8570f20066b1db264ded799 (patch)
tree5139321e24b73eb766d0d1666c28d2d79a8abd00 /usr.bin/make/for.c
parentc45831f7c65accf983e86b1f1a883f20c27133e0 (diff)
downloadFreeBSD-src-92a5e4fdd6e689f9a8570f20066b1db264ded799.zip
FreeBSD-src-92a5e4fdd6e689f9a8570f20066b1db264ded799.tar.gz
Invent a Buf_AppendRange function that appends a non-NUL-terminated string
given by a pointer to the start of the string and a pointer one behind the end. Submitted by: Max Okumoto <okumoto@ucsd.edu>
Diffstat (limited to 'usr.bin/make/for.c')
-rw-r--r--usr.bin/make/for.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/make/for.c b/usr.bin/make/for.c
index b389062..d254e2e 100644
--- a/usr.bin/make/for.c
+++ b/usr.bin/make/for.c
@@ -143,7 +143,7 @@ For_Eval(char *line)
buf = Buf_Init(0);
for (wrd = ptr; *ptr && !isspace((unsigned char)*ptr); ptr++)
continue;
- Buf_AddBytes(buf, ptr - wrd, (Byte *)wrd);
+ Buf_AppendRange(buf, wrd, ptr);
forVar = (char *)Buf_GetAll(buf, &varlen);
if (varlen == 0) {
@@ -181,7 +181,7 @@ For_Eval(char *line)
for (wrd = ptr; *ptr; ptr++)
if (isspace((unsigned char)*ptr)) {
- Buf_AddBytes(buf, ptr - wrd, (Byte *)wrd);
+ Buf_AppendRange(buf, wrd, ptr);
Buf_AddByte(buf, (Byte)'\0');
Lst_AtFront(&forLst, Buf_GetAll(buf, &varlen));
Buf_Destroy(buf, FALSE);
@@ -192,7 +192,7 @@ For_Eval(char *line)
}
DEBUGF(FOR, ("For: Iterator %s List %s\n", forVar, sub));
if (ptr - wrd > 0) {
- Buf_AddBytes(buf, ptr - wrd, (Byte *)wrd);
+ Buf_AppendRange(buf, wrd, ptr);
Buf_AddByte(buf, (Byte)'\0');
Lst_AtFront(&forLst, Buf_GetAll(buf, &varlen));
Buf_Destroy(buf, FALSE);
OpenPOWER on IntegriCloud