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. --- include/mingw.h | 1 + miscutils/make.c | 13 ------------- win32/mingw.c | 12 ++++++++++++ 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/mingw.h b/include/mingw.h index 3cf0526f2..c2c37ba48 100644 --- a/include/mingw.h +++ b/include/mingw.h @@ -594,3 +594,4 @@ const char *applet_to_exe(const char *name); char *get_user_name(void); char *quote_arg(const char *arg); char *find_first_executable(const char *name); +char *xappendword(const char *str, const char *word); diff --git a/miscutils/make.c b/miscutils/make.c index eddc07126..07d824752 100644 --- a/miscutils/make.c +++ b/miscutils/make.c @@ -333,19 +333,6 @@ auto_concat(const char *s1, const char *s2) return auto_string(xasprintf("%s%s", s1, s2)); } -/* - * 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. - */ -static char * -xappendword(const char *str, const char *word) -{ - char *newstr = str ? xasprintf("%s %s", str, word) : xstrdup(word); - free((void *)str); - return newstr; -} - static unsigned int getbucket(const char *name) { 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