diff options
author | harti <harti@FreeBSD.org> | 2005-02-07 15:51:51 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2005-02-07 15:51:51 +0000 |
commit | c300f771987ddaa4c16a5f9d17b2387b55afe1e7 (patch) | |
tree | cb33f60b0ec8c6ba35500cbac5ff2b087cf908b4 /usr.bin/make | |
parent | 1641f9a9ed8a5d8f4b8727bf8c935156378eb414 (diff) | |
download | FreeBSD-src-c300f771987ddaa4c16a5f9d17b2387b55afe1e7.zip FreeBSD-src-c300f771987ddaa4c16a5f9d17b2387b55afe1e7.tar.gz |
Make the intention of a loop clearer.
Submitted by: Max Okumoto <okumoto@ucsd.edu>
Diffstat (limited to 'usr.bin/make')
-rw-r--r-- | usr.bin/make/var.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c index a7ccd59..ad322b2 100644 --- a/usr.bin/make/var.c +++ b/usr.bin/make/var.c @@ -1753,15 +1753,16 @@ Var_Subst(const char *var, char *str, GNode *ctxt, Boolean undefErr) str++; Buf_AddByte(buf, (Byte)*str); str++; - } else if (*str != '$') { + } else if (str[0] != '$') { /* * Skip as many characters as possible -- either to the end of * the string or to the next dollar sign (variable invocation). */ - const char *cp; + const char *cp = str; - for (cp = str++; *str != '$' && *str != '\0'; str++) - continue; + do { + str++; + } while (str[0] != '$' && str[0] != '\0'); Buf_AppendRange(buf, cp, str); } else { if (var != NULL) { |