/[pcre]/code/trunk/pcretest.c
ViewVC logotype

Diff of /code/trunk/pcretest.c

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

revision 541 by ph10, Mon Jun 14 15:19:33 2010 UTC revision 545 by ph10, Wed Jun 16 10:51:15 2010 UTC
# Line 194  static uschar *pbuffer = NULL; Line 194  static uschar *pbuffer = NULL;
194  *         Alternate character tables             *  *         Alternate character tables             *
195  *************************************************/  *************************************************/
196    
197  /* By default, the "tables" pointer when calling PCRE is set to NULL, thereby  /* By default, the "tables" pointer when calling PCRE is set to NULL, thereby
198  using the default tables of the library. However, the T option can be used to  using the default tables of the library. However, the T option can be used to
199  select alternate sets of tables, for different kinds of testing. Note also that  select alternate sets of tables, for different kinds of testing. Note also that
200  the L (locale) option also adjusts the tables. */  the L (locale) option also adjusts the tables. */
201    
202  /* This is the set of tables distributed as default with PCRE. It recognizes  /* This is the set of tables distributed as default with PCRE. It recognizes
203  only ASCII characters. */  only ASCII characters. */
204    
205  static const unsigned char tables0[] = {  static const unsigned char tables0[] = {
# Line 371  graph, print, punct, and cntrl. Other cl Line 371  graph, print, punct, and cntrl. Other cl
371    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 240-247 */    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 240-247 */
372    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};/* 248-255 */    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};/* 248-255 */
373    
374  /* This is a set of tables that came orginally from a Windows user. It seems to  /* This is a set of tables that came orginally from a Windows user. It seems to
375  be at least an approximation of ISO 8859. In particular, there are characters  be at least an approximation of ISO 8859. In particular, there are characters
376  greater than 128 that are marked as spaces, letters, etc. */  greater than 128 that are marked as spaces, letters, etc. */
377    
378  static const unsigned char tables1[] = {  static const unsigned char tables1[] = {
# Line 1567  while (!done) Line 1567  while (!done)
1567        case 'Z': debug_lengths = 0; break;        case 'Z': debug_lengths = 0; break;
1568        case '8': options |= PCRE_UTF8; use_utf8 = 1; break;        case '8': options |= PCRE_UTF8; use_utf8 = 1; break;
1569        case '?': options |= PCRE_NO_UTF8_CHECK; break;        case '?': options |= PCRE_NO_UTF8_CHECK; break;
1570    
1571        case 'T':        case 'T':
1572        switch (*pp++)        switch (*pp++)
1573          {          {
1574          case '0': tables = tables0; break;          case '0': tables = tables0; break;
1575          case '1': tables = tables1; break;          case '1': tables = tables1; break;
1576    
1577          case '\r':          case '\r':
1578          case '\n':          case '\n':
1579          case ' ':          case ' ':
1580          case 0:          case 0:
1581          fprintf(outfile, "** Missing table number after /T\n");          fprintf(outfile, "** Missing table number after /T\n");
1582          goto SKIP_DATA;          goto SKIP_DATA;
1583    
1584          default:          default:
1585          fprintf(outfile, "** Bad table number \"%c\" after /T\n", pp[-1]);          fprintf(outfile, "** Bad table number \"%c\" after /T\n", pp[-1]);
1586          goto SKIP_DATA;          goto SKIP_DATA;
1587          }          }
1588        break;        break;
1589    
1590        case 'L':        case 'L':
1591        ppp = pp;        ppp = pp;
# Line 2081  while (!done) Line 2081  while (!done)
2081    
2082        new_free(re);        new_free(re);
2083        if (extra != NULL) new_free(extra);        if (extra != NULL) new_free(extra);
2084        if (locale_set)        if (locale_set)
2085          {          {
2086          new_free((void *)tables);          new_free((void *)tables);
2087          setlocale(LC_CTYPE, "C");          setlocale(LC_CTYPE, "C");
2088          locale_set = 0;          locale_set = 0;
2089          }          }
2090        continue;  /* With next regex */        continue;  /* With next regex */
2091        }        }
2092      }        /* End of non-POSIX compile */      }        /* End of non-POSIX compile */
# Line 2137  while (!done) Line 2137  while (!done)
2137          {          {
2138          if (len > 0)    /* Reached EOF without hitting a newline */          if (len > 0)    /* Reached EOF without hitting a newline */
2139            {            {
2140            fprintf(outfile, "\n");            fprintf(outfile, "\n");
2141            break;            break;
2142            }            }
2143          done = 1;          done = 1;
2144          goto CONTINUE;          goto CONTINUE;
2145          }          }
# Line 2434  while (!done) Line 2434  while (!done)
2434        }        }
2435      *q = 0;      *q = 0;
2436      len = (int)(q - dbuffer);      len = (int)(q - dbuffer);
2437    
2438      /* Move the data to the end of the buffer so that a read over the end of      /* Move the data to the end of the buffer so that a read over the end of
2439      the buffer will be seen by valgrind, even if it doesn't cause a crash. If      the buffer will be seen by valgrind, even if it doesn't cause a crash. If
2440      we are using the POSIX interface, we must include the terminating zero. */      we are using the POSIX interface, we must include the terminating zero. */

Legend:
Removed from v.541  
changed lines
  Added in v.545

  ViewVC Help
Powered by ViewVC 1.1.5