From 9870f1d1ffe36f77328c001fdf402c94f56c25ce Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 1 Mar 2023 10:36:55 +0100 Subject: [PATCH] Cygwin: wcichr: add wint_t replacement for wcschr Signed-off-by: Corinna Vinschen --- winsup/cygwin/local_includes/wchar.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/winsup/cygwin/local_includes/wchar.h b/winsup/cygwin/local_includes/wchar.h index 125e49ece..d1b638591 100644 --- a/winsup/cygwin/local_includes/wchar.h +++ b/winsup/cygwin/local_includes/wchar.h @@ -72,6 +72,19 @@ wcilen (const wint_t *wcs) return ret; } +/* like wcschr, just for wint_t */ +static inline wint_t * +wcichr (const wint_t *str, wint_t chr) +{ + do + { + if (*str == chr) + return (wint_t *) str; + } + while (*str++); + return NULL; +} + /* like wcscmp, just for wint_t */ static inline int wcicmp (const wint_t *s1, const wint_t *s2)