comparison src/regex.c @ 1414:56496b493888

[xemacs-hg @ 2003-04-15 16:09:46 by stephent] re_match charset bug fix <87of37bv7n.fsf_-_@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Tue, 15 Apr 2003 16:09:47 +0000
parents 19738a2a5138
children 74cb069b8417
comparison
equal deleted inserted replaced
1413:aa15a2bbba1a 1414:56496b493888
5339 5339
5340 5340
5341 case charset: 5341 case charset:
5342 case charset_not: 5342 case charset_not:
5343 { 5343 {
5344 REGISTER unsigned char c; 5344 REGISTER Ichar c;
5345 re_bool not_p = (re_opcode_t) *(p - 1) == charset_not; 5345 re_bool not_p = (re_opcode_t) *(p - 1) == charset_not;
5346 5346
5347 DEBUG_PRINT2 ("EXECUTING charset%s.\n", not_p ? "_not" : ""); 5347 DEBUG_PRINT2 ("EXECUTING charset%s.\n", not_p ? "_not" : "");
5348 5348
5349 REGEX_PREFETCH (); 5349 REGEX_PREFETCH ();
5350 c = itext_ichar_fmt (d, fmt, lispobj); 5350 c = itext_ichar_fmt (d, fmt, lispobj);
5351 c = RE_TRANSLATE (c); /* The character to match. */ 5351 c = RE_TRANSLATE (c); /* The character to match. */
5352 5352
5353 /* Cast to `unsigned int' instead of `unsigned char' in case the 5353 /* Cast to `unsigned int' instead of `unsigned char' in case the
5354 bit list is a full 32 bytes long. */ 5354 bit list is a full 32 bytes long. */
5355 if (c < (unsigned int) (*p * BYTEWIDTH) 5355 if ((unsigned int)c < (unsigned int) (*p * BYTEWIDTH)
5356 && p[1 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH))) 5356 && p[1 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
5357 not_p = !not_p; 5357 not_p = !not_p;
5358 5358
5359 p += 1 + *p; 5359 p += 1 + *p;
5360 5360