aboutsummaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2023-04-21 15:05:49 +0100
committerRon Yorston <rmy@pobox.com>2023-04-21 15:05:49 +0100
commitff8242f51aac4e1b358eac833d6b384ebe1a1116 (patch)
treed97eb54db89b5a24eed8f03c8fc307c77f8eee95 /win32
parent9ce85210e61e6c75adfc0ac0f54643cfee1353be (diff)
downloadbusybox-w32-ff8242f51aac4e1b358eac833d6b384ebe1a1116.tar.gz
busybox-w32-ff8242f51aac4e1b358eac833d6b384ebe1a1116.tar.bz2
busybox-w32-ff8242f51aac4e1b358eac833d6b384ebe1a1116.zip
win32: export xappendword()
The function xappendword() in make.c may have other uses. Export it.
Diffstat (limited to 'win32')
-rw-r--r--win32/mingw.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/win32/mingw.c b/win32/mingw.c
index e81f17f11..9e1cf5eea 100644
--- a/win32/mingw.c
+++ b/win32/mingw.c
@@ -2389,3 +2389,15 @@ const char *applet_to_exe(const char *name)
2389 return name; 2389 return name;
2390} 2390}
2391#endif 2391#endif
2392
2393/*
2394 * Append a word to a space-separated string of words. The first
2395 * call should use a NULL pointer for str, subsequent calls should
2396 * pass an allocated string which will be freed.
2397 */
2398char *xappendword(const char *str, const char *word)
2399{
2400 char *newstr = str ? xasprintf("%s %s", str, word) : xstrdup(word);
2401 free((void *)str);
2402 return newstr;
2403}