summaryrefslogtreecommitdiff
path: root/src/regex-emacs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/regex-emacs.c')
-rw-r--r--src/regex-emacs.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/regex-emacs.c b/src/regex-emacs.c
index 694431c95e2..0ae004e4636 100644
--- a/src/regex-emacs.c
+++ b/src/regex-emacs.c
@@ -2113,17 +2113,20 @@ regex_compile (re_char *pattern, ptrdiff_t size,
if (CHAR_BYTE8_P (c1))
c = BYTE8_TO_CHAR (128);
}
- if (CHAR_BYTE8_P (c))
- {
- c = CHAR_TO_BYTE8 (c);
- c1 = CHAR_TO_BYTE8 (c1);
- for (; c <= c1; c++)
- SET_LIST_BIT (c);
- }
- else if (multibyte)
- SETUP_MULTIBYTE_RANGE (range_table_work, c, c1);
- else
- SETUP_UNIBYTE_RANGE (range_table_work, c, c1);
+ if (c <= c1)
+ {
+ if (CHAR_BYTE8_P (c))
+ {
+ c = CHAR_TO_BYTE8 (c);
+ c1 = CHAR_TO_BYTE8 (c1);
+ for (; c <= c1; c++)
+ SET_LIST_BIT (c);
+ }
+ else if (multibyte)
+ SETUP_MULTIBYTE_RANGE (range_table_work, c, c1);
+ else
+ SETUP_UNIBYTE_RANGE (range_table_work, c, c1);
+ }
}
}