Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2023-03-04 11:51:20 +0300
committerCorinna Vinschen <corinna@vinschen.de>2023-03-14 23:26:22 +0300
commit702dfcc8daf8787d6462f861c5fdc6a552c208e9 (patch)
treeca0c970bef71b59f8178f3e9f7f65cf5f540c44b
parent50b165c28785db9ba7e2c4cb3299eb8e8565af8d (diff)
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 <corinna@vinschen.de>
-rw-r--r--winsup/cygwin/regex/regexec.c2
-rw-r--r--winsup/cygwin/regex/tre.h2
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)