summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2002-04-14 04:15:34 +0000
committerobrien <obrien@FreeBSD.org>2002-04-14 04:15:34 +0000
commit0b2395fb4aa76ce82c1923884c2344bdc20bdb0f (patch)
tree903a5da14b8e65df19a3fa9cb9710531c389f93f /usr.bin
parentc7a49307c426fd39b9bd8f77c6cff16a25a9f41c (diff)
downloadFreeBSD-src-0b2395fb4aa76ce82c1923884c2344bdc20bdb0f.zip
FreeBSD-src-0b2395fb4aa76ce82c1923884c2344bdc20bdb0f.tar.gz
Back out rev 1.17, it breaks dependencies.
With rev 1.7 one cannot build src/bin/sh -- because make fails to create the buildtools before trying to use them. Actually it does compile the buildtools into .o's before trying to use them, but not all the way into binaries.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/make/str.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/usr.bin/make/str.c b/usr.bin/make/str.c
index 03ff7a4a..4889ec9 100644
--- a/usr.bin/make/str.c
+++ b/usr.bin/make/str.c
@@ -94,30 +94,26 @@ str_concat(s1, s2, flags)
char *result;
/* get the length of both strings */
- len1 = s1 == NULL ? 0 : strlen(s1);
- len2 = s2 == NULL ? 0 : strlen(s2);
+ len1 = strlen(s1);
+ len2 = strlen(s2);
/* allocate length plus separator plus EOS */
result = emalloc((u_int)(len1 + len2 + 2));
/* copy first string into place */
- if (len1)
- memcpy(result, s1, len1);
+ memcpy(result, s1, len1);
/* add separator character */
- if (len1 && len2) {
- if (flags & STR_ADDSPACE)
- result[len1++] = ' ';
- else if (flags & STR_ADDSLASH)
- result[len1++] = '/';
+ if (flags & STR_ADDSPACE) {
+ result[len1] = ' ';
+ ++len1;
+ } else if (flags & STR_ADDSLASH) {
+ result[len1] = '/';
+ ++len1;
}
- /* copy second string into place */
- if (len2)
- memcpy(result + len1, s2, len2);
-
- /* Terminate. */
- result[len1 + len2] = '\0';
+ /* copy second string plus EOS into place */
+ memcpy(result + len1, s2, len2 + 1);
/* free original strings */
if (flags & STR_DOFREE) {
OpenPOWER on IntegriCloud