From 702dfcc8daf8787d6462f861c5fdc6a552c208e9 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sat, 4 Mar 2023 09:51:20 +0100 Subject: Cygwin: regex: fix type of tre_char_t to wint_t ...and call mbrtowi instead of mbtowc in regexec, too. Signed-off-by: Corinna Vinschen --- winsup/cygwin/regex/regexec.c | 2 +- winsup/cygwin/regex/tre.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/regex/regexec.c b/winsup/cygwin/regex/regexec.c index a43f60e0f..65ad36c50 100644 --- a/winsup/cygwin/regex/regexec.c +++ b/winsup/cygwin/regex/regexec.c @@ -52,7 +52,7 @@ tre_fill_pmatch(size_t nmatch, regmatch_t pmatch[], int cflags, #define GET_NEXT_WCHAR() do { \ prev_c = next_c; pos += pos_add_next; \ - if ((pos_add_next = mbtowc(&next_c, str_byte, MB_LEN_MAX)) <= 0) { \ + if ((pos_add_next = mbrtowi(&next_c, str_byte, MB_LEN_MAX, NULL)) <= 0) { \ if (pos_add_next < 0) { ret = REG_NOMATCH; goto error_exit; } \ else pos_add_next++; \ } \ diff --git a/winsup/cygwin/regex/tre.h b/winsup/cygwin/regex/tre.h index 03f85a8f6..9ffcd5efe 100644 --- a/winsup/cygwin/regex/tre.h +++ b/winsup/cygwin/regex/tre.h @@ -41,7 +41,7 @@ #define TRE_REGEX_T_FIELD __opaque typedef int reg_errcode_t; -typedef wchar_t tre_char_t; +typedef wint_t tre_char_t; #define DPRINT(msg) do { } while(0) -- cgit v1.2.3