From b52b7b9f65b0edfe28f0b16a4aa72f1b76cf8820 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 26 Aug 2014 21:26:56 +0300 Subject: Sync regex with GLIBC. --- regex_internal.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'regex_internal.c') diff --git a/regex_internal.c b/regex_internal.c index 056cff3d..9e427081 100644 --- a/regex_internal.c +++ b/regex_internal.c @@ -545,7 +545,10 @@ build_upper_buffer (re_string_t *pstr) int ch = pstr->raw_mbs[pstr->raw_mbs_idx + char_idx]; if (BE (pstr->trans != NULL, 0)) ch = pstr->trans[ch]; - pstr->mbs[char_idx] = toupper (ch); + if (islower (ch)) + pstr->mbs[char_idx] = toupper (ch); + else + pstr->mbs[char_idx] = ch; } pstr->valid_len = char_idx; pstr->valid_raw_len = char_idx; @@ -683,7 +686,7 @@ re_string_reconstruct (re_string_t *pstr, int idx, int eflags) pstr->valid_len - offset); pstr->valid_len -= offset; pstr->valid_raw_len -= offset; -#if DEBUG +#if defined DEBUG && DEBUG assert (pstr->valid_len > 0); #endif } @@ -940,7 +943,7 @@ re_string_context_at (const re_string_t *input, int idx, int eflags) int wc_idx = idx; while(input->wcs[wc_idx] == WEOF) { -#ifdef DEBUG +#if defined DEBUG && DEBUG /* It must not happen. */ assert (wc_idx >= 0); #endif -- cgit v1.2.3