aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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,
2113 if (CHAR_BYTE8_P (c1)) 2113 if (CHAR_BYTE8_P (c1))
2114 c = BYTE8_TO_CHAR (128); 2114 c = BYTE8_TO_CHAR (128);
2115 } 2115 }
2116 if (CHAR_BYTE8_P (c)) 2116 if (c <= c1)
2117 { 2117 {
2118 c = CHAR_TO_BYTE8 (c); 2118 if (CHAR_BYTE8_P (c))
2119 c1 = CHAR_TO_BYTE8 (c1); 2119 {
2120 for (; c <= c1; c++) 2120 c = CHAR_TO_BYTE8 (c);
2121 SET_LIST_BIT (c); 2121 c1 = CHAR_TO_BYTE8 (c1);
2122 } 2122 for (; c <= c1; c++)
2123 else if (multibyte) 2123 SET_LIST_BIT (c);
2124 SETUP_MULTIBYTE_RANGE (range_table_work, c, c1); 2124 }
2125 else 2125 else if (multibyte)
2126 SETUP_UNIBYTE_RANGE (range_table_work, c, c1); 2126 SETUP_MULTIBYTE_RANGE (range_table_work, c, c1);
2127 else
2128 SETUP_UNIBYTE_RANGE (range_table_work, c, c1);
2129 }
2127 } 2130 }
2128 } 2131 }
2129 2132