diff options
author | jkh <jkh@FreeBSD.org> | 1995-10-25 15:38:37 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1995-10-25 15:38:37 +0000 |
commit | d4d9564530f574c891a76bc0ca7af4c9275e9442 (patch) | |
tree | 38f96dd54eeecc8a263b88c6c73dd075dcbadb38 /usr.sbin/pkg_install/lib/str.c | |
parent | a31022b303ea5ec7c096c6165e363e3fd1058fee (diff) | |
download | FreeBSD-src-d4d9564530f574c891a76bc0ca7af4c9275e9442.zip FreeBSD-src-d4d9564530f574c891a76bc0ca7af4c9275e9442.tar.gz |
Bring forward my changes from 2.1
Diffstat (limited to 'usr.sbin/pkg_install/lib/str.c')
-rw-r--r-- | usr.sbin/pkg_install/lib/str.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/usr.sbin/pkg_install/lib/str.c b/usr.sbin/pkg_install/lib/str.c index 3e39780..a9f1300 100644 --- a/usr.sbin/pkg_install/lib/str.c +++ b/usr.sbin/pkg_install/lib/str.c @@ -35,6 +35,18 @@ basename_of(char *str) return basename; } +char * +strconcat(char *s1, char *s2) +{ + static char tmp[FILENAME_MAX]; + + tmp[0] = '\0'; + strncpy(tmp, s1 ? s1 : s2, FILENAME_MAX); + if (s1 && s2) + strncat(tmp, s2, FILENAME_MAX - strlen(tmp)); + return tmp; +} + /* Get a string parameter as a file spec or as a "contents follow -" spec */ char * get_dash_string(char **str) |