aboutsummaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2023-04-23 09:00:04 +0100
committerRon Yorston <rmy@pobox.com>2023-04-23 09:04:01 +0100
commit0575aaaa0779812752427badbc0f80a09aac02a4 (patch)
tree350b636dad1766e43d1d0c7d132a895c3cc2a628 /win32
parent7b81a44c87cf71dfb4f647ba107624e208ffbefe (diff)
downloadbusybox-w32-0575aaaa0779812752427badbc0f80a09aac02a4.tar.gz
busybox-w32-0575aaaa0779812752427badbc0f80a09aac02a4.tar.bz2
busybox-w32-0575aaaa0779812752427badbc0f80a09aac02a4.zip
win32: export xappendword()
Export the function xappendword() from make. Use it in drop and watch. Saves 8-80 bytes, an unusually large disparity.
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}