summaryrefslogtreecommitdiffstats
path: root/usr.bin/make/str.c
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2004-12-08 08:11:59 +0000
committerharti <harti@FreeBSD.org>2004-12-08 08:11:59 +0000
commitbde7bbf9ad62c24bcf5c8ca7fc0423db69e01699 (patch)
treea7ee9927fa2e9d0ed7221a08d2ef7ecdf58e3840 /usr.bin/make/str.c
parent979de51e35ba33e737fc2b53a531376af247283d (diff)
downloadFreeBSD-src-bde7bbf9ad62c24bcf5c8ca7fc0423db69e01699.zip
FreeBSD-src-bde7bbf9ad62c24bcf5c8ca7fc0423db69e01699.tar.gz
Consify the arguments to str_concat. Remove the STR_DOFREE flag for that
purpose and explicitely free the input string in the one place that was calling str_concat with that flag. Submitted by: Max Okumoto <okumoto@ucsd.edu>
Diffstat (limited to 'usr.bin/make/str.c')
-rw-r--r--usr.bin/make/str.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/usr.bin/make/str.c b/usr.bin/make/str.c
index a05d09e..7a1dd6c 100644
--- a/usr.bin/make/str.c
+++ b/usr.bin/make/str.c
@@ -80,14 +80,13 @@ str_end(void)
/*-
* str_concat --
- * concatenate the two strings, inserting a space or slash between them,
- * freeing them if requested.
+ * concatenate the two strings, inserting a space or slash between them.
*
* returns --
* the resulting string in allocated space.
*/
char *
-str_concat(char *s1, char *s2, int flags)
+str_concat(const char *s1, const char *s2, int flags)
{
int len1, len2;
char *result;
@@ -114,11 +113,6 @@ str_concat(char *s1, char *s2, int flags)
/* copy second string plus EOS into place */
memcpy(result + len1, s2, len2 + 1);
- /* free original strings */
- if (flags & STR_DOFREE) {
- free(s1);
- free(s2);
- }
return (result);
}
OpenPOWER on IntegriCloud