summaryrefslogtreecommitdiff
path: root/support/regcomp.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2018-08-10 11:45:16 +0300
committerArnold D. Robbins <arnold@skeeve.com>2018-08-10 11:45:16 +0300
commit84b71627b3986acde819444a6644130e22309fc5 (patch)
tree54efd76791a2c9fb307e944e6b4b53c85d133fa3 /support/regcomp.c
parentbdcad8e531d886fb0074b1239ced50ee1cd5252e (diff)
downloadgawk-84b71627b3986acde819444a6644130e22309fc5.tar.gz
Fix regcomp.c:parse_byte to get full RRI.
Diffstat (limited to 'support/regcomp.c')
-rw-r--r--support/regcomp.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/support/regcomp.c b/support/regcomp.c
index 3b0a3c6b..e81652f2 100644
--- a/support/regcomp.c
+++ b/support/regcomp.c
@@ -2684,15 +2684,14 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa,
# ifdef RE_ENABLE_I18N
/* Convert the byte B to the corresponding wide character. In a
- unibyte locale, treat B as itself if it is an encoding error.
- In a multibyte locale, return WEOF if B is an encoding error. */
+ unibyte locale, treat B as itself. In a multibyte locale, return
+ WEOF if B is an encoding error. */
static wint_t
parse_byte (unsigned char b, re_charset_t *mbcset)
{
- wint_t wc = __btowc (b);
- return wc == WEOF && !mbcset ? b : wc;
+ return mbcset == NULL ? b : __btowc (b);
}
-#endif
+# endif
/* Local function for parse_bracket_exp only used in case of NOT _LIBC.
Build the range expression which starts from START_ELEM, and ends