diff options
| author | Jim Blandy | 1992-12-14 02:28:29 +0000 |
|---|---|---|
| committer | Jim Blandy | 1992-12-14 02:28:29 +0000 |
| commit | 4af46de60c1d273d1caf137799594a8f820538d1 (patch) | |
| tree | 3906b363bf22b0d493c8fd294a4d6f29cdc06b88 /src | |
| parent | 1d650ff1bdcc1400a54ad77e8d074b880df66c80 (diff) | |
| download | emacs-4af46de60c1d273d1caf137799594a8f820538d1.tar.gz emacs-4af46de60c1d273d1caf137799594a8f820538d1.zip | |
*** empty log message ***
Diffstat (limited to 'src')
| -rw-r--r-- | src/regex.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/regex.c b/src/regex.c index c1609504dff..b0c15c2ca87 100644 --- a/src/regex.c +++ b/src/regex.c | |||
| @@ -2197,18 +2197,20 @@ compile_range (p_ptr, pend, translate, syntax, b) | |||
| 2197 | unsigned this_char; | 2197 | unsigned this_char; |
| 2198 | 2198 | ||
| 2199 | const char *p = *p_ptr; | 2199 | const char *p = *p_ptr; |
| 2200 | int range_start, range_end; | ||
| 2200 | 2201 | ||
| 2201 | /* Even though the pattern is a signed `char *', we need to fetch into | ||
| 2202 | `unsigned char's. Reason: if the high bit of the pattern character | ||
| 2203 | is set, the range endpoints will be negative if we fetch into a | ||
| 2204 | signed `char *'. */ | ||
| 2205 | unsigned char range_end; | ||
| 2206 | unsigned char range_start = p[-2]; | ||
| 2207 | |||
| 2208 | if (p == pend) | 2202 | if (p == pend) |
| 2209 | return REG_ERANGE; | 2203 | return REG_ERANGE; |
| 2210 | 2204 | ||
| 2211 | PATFETCH (range_end); | 2205 | /* Even though the pattern is a signed `char *', we need to fetch |
| 2206 | with unsigned char *'s; if the high bit of the pattern character | ||
| 2207 | is set, the range endpoints will be negative if we fetch using a | ||
| 2208 | signed char *. | ||
| 2209 | |||
| 2210 | We also want to fetch the endpoints without translating them; the | ||
| 2211 | appropriate translation is done in the bit-setting loop below. */ | ||
| 2212 | range_start = ((unsigned char *) p)[-2]; | ||
| 2213 | range_end = ((unsigned char *) p)[0]; | ||
| 2212 | 2214 | ||
| 2213 | /* Have to increment the pointer into the pattern string, so the | 2215 | /* Have to increment the pointer into the pattern string, so the |
| 2214 | caller isn't still at the ending character. */ | 2216 | caller isn't still at the ending character. */ |