From ff8242f51aac4e1b358eac833d6b384ebe1a1116 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Fri, 21 Apr 2023 15:05:49 +0100 Subject: win32: export xappendword() The function xappendword() in make.c may have other uses. Export it. --- win32/mingw.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'win32') 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) return name; } #endif + +/* + * Append a word to a space-separated string of words. The first + * call should use a NULL pointer for str, subsequent calls should + * pass an allocated string which will be freed. + */ +char *xappendword(const char *str, const char *word) +{ + char *newstr = str ? xasprintf("%s %s", str, word) : xstrdup(word); + free((void *)str); + return newstr; +} -- cgit v1.2.3-55-g6feb