diff --git a/winsup/cygwin/glob.cc b/winsup/cygwin/glob.cc index 63a07a930..0b85a147a 100644 --- a/winsup/cygwin/glob.cc +++ b/winsup/cygwin/glob.cc @@ -481,12 +481,6 @@ globtilde(const Char *pattern, Char *patbuf, size_t patbuf_len, glob_t *pglob) return patbuf; } -static void -wcitoascii(char *dst, wint_t *src) -{ - while ((*dst++ = *src++)); -} - /* * The main glob() routine: compiles the pattern (optionally processing * quotes), calls glob1() to do the real pattern matching, and finally diff --git a/winsup/cygwin/local_includes/wchar.h b/winsup/cygwin/local_includes/wchar.h index 3907732a2..b09d014c0 100644 --- a/winsup/cygwin/local_includes/wchar.h +++ b/winsup/cygwin/local_includes/wchar.h @@ -52,6 +52,14 @@ size_t wirtomb (char *, wint_t, mbstate_t *); a UTF-32 value. Defined in strfuncs.cc */ extern size_t mbrtowi (wint_t *, const char *, size_t, mbstate_t *); +/* convert wint_t string to char string, but *only* if the string consists + entirely of ASCII chars */ +static inline void +wcitoascii(char *dst, wint_t *src) +{ + while ((*dst++ = *src++)); +} + /* like wcslen, just for wint_t */ static inline size_t wcilen (const wint_t *wcs)