/[pcre]/code/branches/pcre16/pcre_xclass.c
ViewVC logotype

Diff of /code/branches/pcre16/pcre_xclass.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 794 by zherczeg, Mon Nov 28 20:39:30 2011 UTC revision 795 by zherczeg, Sat Dec 10 02:20:06 2011 UTC
# Line 64  Returns:      TRUE if character matches, Line 64  Returns:      TRUE if character matches,
64  */  */
65    
66  BOOL  BOOL
67  PRIV(xclass)(int c, const pcre_uchar *data)  PRIV(xclass)(int c, const pcre_uchar *data, BOOL utf)
68  {  {
69  int t;  int t;
70  BOOL negated = (*data & XCL_NOT) != 0;  BOOL negated = (*data & XCL_NOT) != 0;
71    
72    (void)utf;
73    #ifdef COMPILE_PCRE8
74    /* In 8 bit mode, this must always be TRUE. Help the compiler to know that. */
75    utf = TRUE;
76    #endif
77    
78  /* Character values < 256 are matched against a bitmap, if one is present. If  /* Character values < 256 are matched against a bitmap, if one is present. If
79  not, we still carry on, because there may be ranges that start below 256 in the  not, we still carry on, because there may be ranges that start below 256 in the
80  additional data. */  additional data. */
# Line 91  while ((t = *data++) != XCL_END) Line 97  while ((t = *data++) != XCL_END)
97    int x, y;    int x, y;
98    if (t == XCL_SINGLE)    if (t == XCL_SINGLE)
99      {      {
100      GETCHARINC(x, data);  #ifdef SUPPORT_UTF
101        if (utf)
102          {
103          GETCHARINC(x, data); /* macro generates multiple statements */
104          }
105        else
106    #endif
107          x = *data++;
108      if (c == x) return !negated;      if (c == x) return !negated;
109      }      }
110    else if (t == XCL_RANGE)    else if (t == XCL_RANGE)
111      {      {
112      GETCHARINC(x, data);  #ifdef SUPPORT_UTF
113      GETCHARINC(y, data);      if (utf)
114          {
115          GETCHARINC(x, data); /* macro generates multiple statements */
116          GETCHARINC(y, data); /* macro generates multiple statements */
117          }
118        else
119    #endif
120          {
121          x = *data++;
122          y = *data++;
123          }
124      if (c >= x && c <= y) return !negated;      if (c >= x && c <= y) return !negated;
125      }      }
126    

Legend:
Removed from v.794  
changed lines
  Added in v.795

  ViewVC Help
Powered by ViewVC 1.1.5