aboutsummaryrefslogtreecommitdiffstats
path: root/regex_internal.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2014-09-10 08:18:21 +0300
committerArnold D. Robbins <arnold@skeeve.com>2014-09-10 08:18:21 +0300
commit6de0102373304c0fdf70a7ddeb17dd1caa3a9b23 (patch)
tree7a8f3f18180e0b84893a4cccd883c80ffb7d9bc0 /regex_internal.c
parentd7c8dfd41bd5671ddfa6c81b2ef1779cab06e56b (diff)
parentca9f23d6c33c4b5cb3786d480948a42988ca99ac (diff)
downloadegawk-6de0102373304c0fdf70a7ddeb17dd1caa3a9b23.tar.gz
egawk-6de0102373304c0fdf70a7ddeb17dd1caa3a9b23.tar.bz2
egawk-6de0102373304c0fdf70a7ddeb17dd1caa3a9b23.zip
Merge branch 'master' into comment
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