aboutsummaryrefslogtreecommitdiffstats
path: root/regex_internal.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2014-08-26 21:35:37 +0300
committerArnold D. Robbins <arnold@skeeve.com>2014-08-26 21:35:37 +0300
commit3a2e4e1b409d87ade30d3ad2976695235347f13b (patch)
treea556b87c9bbfbb2fb8522493ed2d9ed92c99691f /regex_internal.c
parent12e05615041147de61658bda8f5e7d5a4acd87c3 (diff)
parenta5847cb0a97b093cd0f23b65c72370af836c9748 (diff)
downloadegawk-3a2e4e1b409d87ade30d3ad2976695235347f13b.tar.gz
egawk-3a2e4e1b409d87ade30d3ad2976695235347f13b.tar.bz2
egawk-3a2e4e1b409d87ade30d3ad2976695235347f13b.zip
Merge branch 'gawk-4.1-stable'
Diffstat (limited to 'regex_internal.c')
-rw-r--r--regex_internal.c9
1 files changed, 6 insertions, 3 deletions
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