comparison src/regex.c @ 4832:07fa38c30fdf

fix messed-up fastmap calculation in charset_mule_not
author Ben Wing <ben@xemacs.org>
date Sun, 10 Jan 2010 00:49:30 -0600
parents aa5ed11f473b
children 16112448d484
comparison
equal deleted inserted replaced
4831:2e15c29cc2b3 4832:07fa38c30fdf
3839 3839
3840 case charset_mule_not: 3840 case charset_mule_not:
3841 { 3841 {
3842 int nentries; 3842 int nentries;
3843 int i; 3843 int i;
3844 int smallest_prev = 0;
3844 3845
3845 nentries = unified_range_table_nentries (p); 3846 nentries = unified_range_table_nentries (p);
3846 for (i = 0; i < nentries; i++) 3847 for (i = 0; i < nentries; i++)
3847 { 3848 {
3848 EMACS_INT first, last; 3849 EMACS_INT first, last;
3849 Lisp_Object dummy_val; 3850 Lisp_Object dummy_val;
3850 int jj; 3851 int jj;
3851 int smallest_prev = 0;
3852 3852
3853 unified_range_table_get_range (p, i, &first, &last, 3853 unified_range_table_get_range (p, i, &first, &last,
3854 &dummy_val); 3854 &dummy_val);
3855 for (jj = smallest_prev; jj < first && jj < 0x80; jj++) 3855 for (jj = smallest_prev; jj < first && jj < 0x80; jj++)
3856 fastmap[jj] = 1; 3856 fastmap[jj] = 1;
3857 smallest_prev = last + 1; 3857 smallest_prev = last + 1;
3858 if (smallest_prev >= 0x80) 3858 if (smallest_prev >= 0x80)
3859 break; 3859 break;
3860 } 3860 }
3861
3862 /* Also set lead bytes after the end */
3863 for (i = smallest_prev; i < 0x80; i++)
3864 fastmap[i] = 1;
3865
3861 /* Calculating which leading bytes are actually allowed 3866 /* Calculating which leading bytes are actually allowed
3862 here is rather difficult, so we just punt and allow 3867 here is rather difficult, so we just punt and allow
3863 all of them. */ 3868 all of them. */
3864 for (i = 0x80; i < 0xA0; i++) 3869 for (i = 0x80; i < 0xA0; i++)
3865 fastmap[i] = 1; 3870 fastmap[i] = 1;