aboutsummaryrefslogtreecommitdiffstats
path: root/regex_internal.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2014-08-26 21:26:56 +0300
committerArnold D. Robbins <arnold@skeeve.com>2014-08-26 21:26:56 +0300
commitb52b7b9f65b0edfe28f0b16a4aa72f1b76cf8820 (patch)
tree3a316a8f66444a3ac616eb68c02c296888759587 /regex_internal.c
parent5167f5aaabb5adb4801be9f46ba3ba16596014c3 (diff)
downloadegawk-b52b7b9f65b0edfe28f0b16a4aa72f1b76cf8820.tar.gz
egawk-b52b7b9f65b0edfe28f0b16a4aa72f1b76cf8820.tar.bz2
egawk-b52b7b9f65b0edfe28f0b16a4aa72f1b76cf8820.zip
Sync regex with GLIBC.
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