/[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 836 by ph10, Wed Dec 28 17:16:11 2011 UTC revision 908 by ph10, Mon Jan 30 12:19:29 2012 UTC
# Line 105  input mode under Windows. */ Line 105  input mode under Windows. */
105  #define OUTPUT_MODE  "wb"  #define OUTPUT_MODE  "wb"
106  #endif  #endif
107    
108    #define PRIV(name) name
109    
110  /* We have to include pcre_internal.h because we need the internal info for  /* We have to include pcre_internal.h because we need the internal info for
111  displaying the results of pcre_study() and we also need to know about the  displaying the results of pcre_study() and we also need to know about the
# Line 141  to keep two copies, we include the sourc Line 142  to keep two copies, we include the sourc
142  external symbols to prevent clashes. */  external symbols to prevent clashes. */
143    
144  #define PCRE_INCLUDED  #define PCRE_INCLUDED
 #undef PRIV  
 #define PRIV(name) name  
145    
146  #include "pcre_tables.c"  #include "pcre_tables.c"
147    
# Line 209  argument, the casting might be incorrect Line 208  argument, the casting might be incorrect
208  #define READ_CAPTURE_NAME8(p, cn8, cn16, re) \  #define READ_CAPTURE_NAME8(p, cn8, cn16, re) \
209    p = read_capture_name8(p, cn8, re)    p = read_capture_name8(p, cn8, re)
210    
211    #define STRLEN8(p) ((int)strlen((char *)p))
212    
213  #define SET_PCRE_CALLOUT8(callout) \  #define SET_PCRE_CALLOUT8(callout) \
214    pcre_callout = callout    pcre_callout = callout
215    
216  #define STRLEN8(p) ((int)strlen((char *)p))  #define PCRE_ASSIGN_JIT_STACK8(extra, callback, userdata) \
217       pcre_assign_jit_stack(extra, callback, userdata)
218    
219  #define PCRE_COMPILE8(re, pat, options, error, erroffset, tables) \  #define PCRE_COMPILE8(re, pat, options, error, erroffset, tables) \
220    re = pcre_compile((char *)pat, options, error, erroffset, tables)    re = pcre_compile((char *)pat, options, error, erroffset, tables)
# Line 259  argument, the casting might be incorrect Line 260  argument, the casting might be incorrect
260  #define PCRE_GET_SUBSTRING_LIST8(rc, bptr, offsets, count, listptr) \  #define PCRE_GET_SUBSTRING_LIST8(rc, bptr, offsets, count, listptr) \
261    rc = pcre_get_substring_list((const char *)bptr, offsets, count, listptr)    rc = pcre_get_substring_list((const char *)bptr, offsets, count, listptr)
262    
263  #define PCRE_PATTERN_TO_HOST_BYTE_ORDER8(re, extra, tables) \  #define PCRE_PATTERN_TO_HOST_BYTE_ORDER8(rc, re, extra, tables) \
264    pcre_pattern_to_host_byte_order(re, extra, tables)    rc = pcre_pattern_to_host_byte_order(re, extra, tables)
265    
266  #define PCRE_PRINTINT8(re, outfile, debug_lengths) \  #define PCRE_PRINTINT8(re, outfile, debug_lengths) \
267    pcre_printint(re, outfile, debug_lengths)    pcre_printint(re, outfile, debug_lengths)
# Line 268  argument, the casting might be incorrect Line 269  argument, the casting might be incorrect
269  #define PCRE_STUDY8(extra, re, options, error) \  #define PCRE_STUDY8(extra, re, options, error) \
270    extra = pcre_study(re, options, error)    extra = pcre_study(re, options, error)
271    
272    #define PCRE_JIT_STACK_ALLOC8(startsize, maxsize) \
273      pcre_jit_stack_alloc(startsize, maxsize)
274    
275    #define PCRE_JIT_STACK_FREE8(stack) \
276      pcre_jit_stack_free(stack)
277    
278  #endif /* SUPPORT_PCRE8 */  #endif /* SUPPORT_PCRE8 */
279    
280  /* -----------------------------------------------------------*/  /* -----------------------------------------------------------*/
# Line 286  argument, the casting might be incorrect Line 293  argument, the casting might be incorrect
293  #define STRLEN16(p) ((int)strlen16((PCRE_SPTR16)p))  #define STRLEN16(p) ((int)strlen16((PCRE_SPTR16)p))
294    
295  #define SET_PCRE_CALLOUT16(callout) \  #define SET_PCRE_CALLOUT16(callout) \
296    pcre16_callout = callout    pcre16_callout = (int (*)(pcre16_callout_block *))callout
297    
298    #define PCRE_ASSIGN_JIT_STACK16(extra, callback, userdata) \
299      pcre16_assign_jit_stack((pcre16_extra *)extra, \
300        (pcre16_jit_callback)callback, userdata)
301    
302  #define PCRE_COMPILE16(re, pat, options, error, erroffset, tables) \  #define PCRE_COMPILE16(re, pat, options, error, erroffset, tables) \
303    re = pcre16_compile((PCRE_SPTR16)pat, options, error, erroffset, tables)    re = (pcre *)pcre16_compile((PCRE_SPTR16)pat, options, error, erroffset, \
304        tables)
305    
306  #define PCRE_COPY_NAMED_SUBSTRING16(rc, re, bptr, offsets, count, \  #define PCRE_COPY_NAMED_SUBSTRING16(rc, re, bptr, offsets, count, \
307      namesptr, cbuffer, size) \      namesptr, cbuffer, size) \
308    rc = pcre16_copy_named_substring(re, (PCRE_SPTR16)bptr, offsets, count, \    rc = pcre16_copy_named_substring((pcre16 *)re, (PCRE_SPTR16)bptr, offsets, \
309      (PCRE_SPTR16)namesptr, (PCRE_SCHAR16 *)cbuffer, size/2)      count, (PCRE_SPTR16)namesptr, (PCRE_UCHAR16 *)cbuffer, size/2)
310    
311  #define PCRE_COPY_SUBSTRING16(rc, bptr, offsets, count, i, cbuffer, size) \  #define PCRE_COPY_SUBSTRING16(rc, bptr, offsets, count, i, cbuffer, size) \
312    rc = pcre16_copy_substring((PCRE_SPTR16)bptr, offsets, count, i, \    rc = pcre16_copy_substring((PCRE_SPTR16)bptr, offsets, count, i, \
313      (PCRE_SCHAR16 *)cbuffer, size/2)      (PCRE_UCHAR16 *)cbuffer, size/2)
314    
315  #define PCRE_DFA_EXEC16(count, re, extra, bptr, len, start_offset, options, \  #define PCRE_DFA_EXEC16(count, re, extra, bptr, len, start_offset, options, \
316      offsets, size_offsets, workspace, size_workspace) \      offsets, size_offsets, workspace, size_workspace) \
317    count = pcre16_dfa_exec(re, extra, (PCRE_SPTR16)bptr, len, start_offset, \    count = pcre16_dfa_exec((pcre16 *)re, (pcre16_extra *)extra, \
318      options, offsets, size_offsets, workspace, size_workspace)      (PCRE_SPTR16)bptr, len, start_offset, options, offsets, size_offsets, \
319        workspace, size_workspace)
320    
321  #define PCRE_EXEC16(count, re, extra, bptr, len, start_offset, options, \  #define PCRE_EXEC16(count, re, extra, bptr, len, start_offset, options, \
322      offsets, size_offsets) \      offsets, size_offsets) \
323    count = pcre16_exec(re, extra, (PCRE_SPTR16)bptr, len, start_offset, \    count = pcre16_exec((pcre16 *)re, (pcre16_extra *)extra, (PCRE_SPTR16)bptr, \
324      options, offsets, size_offsets)      len, start_offset, options, offsets, size_offsets)
325    
326  #define PCRE_FREE_STUDY16(extra) \  #define PCRE_FREE_STUDY16(extra) \
327    pcre16_free_study(extra)    pcre16_free_study((pcre16_extra *)extra)
328    
329  #define PCRE_FREE_SUBSTRING16(substring) \  #define PCRE_FREE_SUBSTRING16(substring) \
330    pcre16_free_substring((PCRE_SPTR16)substring)    pcre16_free_substring((PCRE_SPTR16)substring)
# Line 322  argument, the casting might be incorrect Line 334  argument, the casting might be incorrect
334    
335  #define PCRE_GET_NAMED_SUBSTRING16(rc, re, bptr, offsets, count, \  #define PCRE_GET_NAMED_SUBSTRING16(rc, re, bptr, offsets, count, \
336      getnamesptr, subsptr) \      getnamesptr, subsptr) \
337    rc = pcre16_get_named_substring(re, (PCRE_SPTR16)bptr, offsets, count, \    rc = pcre16_get_named_substring((pcre16 *)re, (PCRE_SPTR16)bptr, offsets, \
338      (PCRE_SPTR16)getnamesptr, (PCRE_SPTR16 *)(void*)subsptr)      count, (PCRE_SPTR16)getnamesptr, (PCRE_SPTR16 *)(void*)subsptr)
339    
340  #define PCRE_GET_STRINGNUMBER16(n, rc, ptr) \  #define PCRE_GET_STRINGNUMBER16(n, rc, ptr) \
341    n = pcre16_get_stringnumber(re, (PCRE_SPTR16)ptr)    n = pcre16_get_stringnumber(re, (PCRE_SPTR16)ptr)
# Line 336  argument, the casting might be incorrect Line 348  argument, the casting might be incorrect
348    rc = pcre16_get_substring_list((PCRE_SPTR16)bptr, offsets, count, \    rc = pcre16_get_substring_list((PCRE_SPTR16)bptr, offsets, count, \
349      (PCRE_SPTR16 **)(void*)listptr)      (PCRE_SPTR16 **)(void*)listptr)
350    
351  #define PCRE_PATTERN_TO_HOST_BYTE_ORDER16(re, extra, tables) \  #define PCRE_PATTERN_TO_HOST_BYTE_ORDER16(rc, re, extra, tables) \
352    pcre16_pattern_to_host_byte_order(re, extra, tables)    rc = pcre16_pattern_to_host_byte_order((pcre16 *)re, (pcre16_extra *)extra, \
353        tables)
354    
355  #define PCRE_PRINTINT16(re, outfile, debug_lengths) \  #define PCRE_PRINTINT16(re, outfile, debug_lengths) \
356    pcre16_printint(re, outfile, debug_lengths)    pcre16_printint(re, outfile, debug_lengths)
357    
358  #define PCRE_STUDY16(extra, re, options, error) \  #define PCRE_STUDY16(extra, re, options, error) \
359    extra = pcre16_study(re, options, error)    extra = (pcre_extra *)pcre16_study((pcre16 *)re, options, error)
360    
361    #define PCRE_JIT_STACK_ALLOC16(startsize, maxsize) \
362      (pcre_jit_stack *)pcre16_jit_stack_alloc(startsize, maxsize)
363    
364    #define PCRE_JIT_STACK_FREE16(stack) \
365      pcre16_jit_stack_free((pcre16_jit_stack *)stack)
366    
367  #endif /* SUPPORT_PCRE16 */  #endif /* SUPPORT_PCRE16 */
368    
# Line 382  version is called. ----- */ Line 401  version is called. ----- */
401    
402  #define STRLEN(p) (use_pcre16? STRLEN16(p) : STRLEN8(p))  #define STRLEN(p) (use_pcre16? STRLEN16(p) : STRLEN8(p))
403    
404  #define PCRE_ASSIGN_JIT_STACK pcre_assign_jit_stack  #define PCRE_ASSIGN_JIT_STACK(extra, callback, userdata) \
405      if (use_pcre16) \
406        PCRE_ASSIGN_JIT_STACK16(extra, callback, userdata); \
407      else \
408        PCRE_ASSIGN_JIT_STACK8(extra, callback, userdata)
409    
410  #define PCRE_COMPILE(re, pat, options, error, erroffset, tables) \  #define PCRE_COMPILE(re, pat, options, error, erroffset, tables) \
411    if (use_pcre16) \    if (use_pcre16) \
# Line 470  version is called. ----- */ Line 493  version is called. ----- */
493    else \    else \
494      PCRE_GET_SUBSTRING_LIST8(rc, bptr, offsets, count, listptr)      PCRE_GET_SUBSTRING_LIST8(rc, bptr, offsets, count, listptr)
495    
496  #define PCRE_JIT_STACK_ALLOC pcre_jit_stack_alloc  #define PCRE_JIT_STACK_ALLOC(startsize, maxsize) \
497  #define PCRE_JIT_STACK_FREE pcre_jit_stack_free    (use_pcre16 ? \
498         PCRE_JIT_STACK_ALLOC16(startsize, maxsize) \
499        :PCRE_JIT_STACK_ALLOC8(startsize, maxsize))
500    
501    #define PCRE_JIT_STACK_FREE(stack) \
502      if (use_pcre16) \
503        PCRE_JIT_STACK_FREE16(stack); \
504      else \
505        PCRE_JIT_STACK_FREE8(stack)
506    
507  #define PCRE_MAKETABLES \  #define PCRE_MAKETABLES \
508    (use_pcre16? pcre16_maketables() : pcre_maketables())    (use_pcre16? pcre16_maketables() : pcre_maketables())
509    
510  #define PCRE_PATTERN_TO_HOST_BYTE_ORDER(re, extra, tables) \  #define PCRE_PATTERN_TO_HOST_BYTE_ORDER(rc, re, extra, tables) \
511    if (use_pcre16) \    if (use_pcre16) \
512      PCRE_PATTERN_TO_HOST_BYTE_ORDER16(re, extra, tables); \      PCRE_PATTERN_TO_HOST_BYTE_ORDER16(rc, re, extra, tables); \
513    else \    else \
514      PCRE_PATTERN_TO_HOST_BYTE_ORDER8(re, extra, tables)      PCRE_PATTERN_TO_HOST_BYTE_ORDER8(rc, re, extra, tables)
515    
516  #define PCRE_PRINTINT(re, outfile, debug_lengths) \  #define PCRE_PRINTINT(re, outfile, debug_lengths) \
517    if (use_pcre16) \    if (use_pcre16) \
# Line 503  version is called. ----- */ Line 534  version is called. ----- */
534  #define READ_CAPTURE_NAME         READ_CAPTURE_NAME8  #define READ_CAPTURE_NAME         READ_CAPTURE_NAME8
535  #define SET_PCRE_CALLOUT          SET_PCRE_CALLOUT8  #define SET_PCRE_CALLOUT          SET_PCRE_CALLOUT8
536  #define STRLEN                    STRLEN8  #define STRLEN                    STRLEN8
537  #define PCRE_ASSIGN_JIT_STACK     pcre_assign_jit_stack  #define PCRE_ASSIGN_JIT_STACK     PCRE_ASSIGN_JIT_STACK8
538  #define PCRE_COMPILE              PCRE_COMPILE8  #define PCRE_COMPILE              PCRE_COMPILE8
539  #define PCRE_CONFIG               pcre_config  #define PCRE_CONFIG               pcre_config
540  #define PCRE_COPY_NAMED_SUBSTRING PCRE_COPY_NAMED_SUBSTRING8  #define PCRE_COPY_NAMED_SUBSTRING PCRE_COPY_NAMED_SUBSTRING8
# Line 517  version is called. ----- */ Line 548  version is called. ----- */
548  #define PCRE_GET_STRINGNUMBER     PCRE_GET_STRINGNUMBER8  #define PCRE_GET_STRINGNUMBER     PCRE_GET_STRINGNUMBER8
549  #define PCRE_GET_SUBSTRING        PCRE_GET_SUBSTRING8  #define PCRE_GET_SUBSTRING        PCRE_GET_SUBSTRING8
550  #define PCRE_GET_SUBSTRING_LIST   PCRE_GET_SUBSTRING_LIST8  #define PCRE_GET_SUBSTRING_LIST   PCRE_GET_SUBSTRING_LIST8
551  #define PCRE_JIT_STACK_ALLOC      pcre_jit_stack_alloc  #define PCRE_JIT_STACK_ALLOC      PCRE_JIT_STACK_ALLOC8
552  #define PCRE_JIT_STACK_FREE       pcre_jit_stack_free  #define PCRE_JIT_STACK_FREE       PCRE_JIT_STACK_FREE8
553  #define PCRE_MAKETABLES           pcre_maketables()  #define PCRE_MAKETABLES           pcre_maketables()
554  #define PCRE_PATTERN_TO_HOST_BYTE_ORDER PCRE_PATTERN_TO_HOST_BYTE_ORDER8  #define PCRE_PATTERN_TO_HOST_BYTE_ORDER PCRE_PATTERN_TO_HOST_BYTE_ORDER8
555  #define PCRE_PRINTINT             PCRE_PRINTINT8  #define PCRE_PRINTINT             PCRE_PRINTINT8
# Line 533  version is called. ----- */ Line 564  version is called. ----- */
564  #define READ_CAPTURE_NAME         READ_CAPTURE_NAME16  #define READ_CAPTURE_NAME         READ_CAPTURE_NAME16
565  #define SET_PCRE_CALLOUT          SET_PCRE_CALLOUT16  #define SET_PCRE_CALLOUT          SET_PCRE_CALLOUT16
566  #define STRLEN                    STRLEN16  #define STRLEN                    STRLEN16
567  #define PCRE_ASSIGN_JIT_STACK     pcre16_assign_jit_stack  #define PCRE_ASSIGN_JIT_STACK     PCRE_ASSIGN_JIT_STACK16
568  #define PCRE_COMPILE              PCRE_COMPILE16  #define PCRE_COMPILE              PCRE_COMPILE16
569  #define PCRE_CONFIG               pcre16_config  #define PCRE_CONFIG               pcre16_config
570  #define PCRE_COPY_NAMED_SUBSTRING PCRE_COPY_NAMED_SUBSTRING16  #define PCRE_COPY_NAMED_SUBSTRING PCRE_COPY_NAMED_SUBSTRING16
# Line 547  version is called. ----- */ Line 578  version is called. ----- */
578  #define PCRE_GET_STRINGNUMBER     PCRE_GET_STRINGNUMBER16  #define PCRE_GET_STRINGNUMBER     PCRE_GET_STRINGNUMBER16
579  #define PCRE_GET_SUBSTRING        PCRE_GET_SUBSTRING16  #define PCRE_GET_SUBSTRING        PCRE_GET_SUBSTRING16
580  #define PCRE_GET_SUBSTRING_LIST   PCRE_GET_SUBSTRING_LIST16  #define PCRE_GET_SUBSTRING_LIST   PCRE_GET_SUBSTRING_LIST16
581  #define PCRE_JIT_STACK_ALLOC      pcre16_jit_stack_alloc  #define PCRE_JIT_STACK_ALLOC      PCRE_JIT_STACK_ALLOC16
582  #define PCRE_JIT_STACK_FREE       pcre16_jit_stack_free  #define PCRE_JIT_STACK_FREE       PCRE_JIT_STACK_FREE16
583  #define PCRE_MAKETABLES           pcre16_maketables()  #define PCRE_MAKETABLES           pcre16_maketables()
584  #define PCRE_PATTERN_TO_HOST_BYTE_ORDER PCRE_PATTERN_TO_HOST_BYTE_ORDER16  #define PCRE_PATTERN_TO_HOST_BYTE_ORDER PCRE_PATTERN_TO_HOST_BYTE_ORDER16
585  #define PCRE_PRINTINT             PCRE_PRINTINT16  #define PCRE_PRINTINT             PCRE_PRINTINT16
# Line 625  COMPILE_PCRE16 is *not* set. */ Line 656  COMPILE_PCRE16 is *not* set. */
656  #error LINK_SIZE must be either 2, 3, or 4  #error LINK_SIZE must be either 2, 3, or 4
657  #endif  #endif
658    
659    #undef IMM2_SIZE
660    #define IMM2_SIZE 1
661    
662  #endif /* SUPPORT_PCRE8 */  #endif /* SUPPORT_PCRE8 */
663    
664  static const pcre_uint16 OP_lengths16[] = { OP_LENGTHS };  static const pcre_uint16 OP_lengths16[] = { OP_LENGTHS };
# Line 1123  for (j = i; j > 0; j--) Line 1157  for (j = i; j > 0; j--)
1157  *utf8bytes = utf8_table2[i] | cvalue;  *utf8bytes = utf8_table2[i] | cvalue;
1158  return i + 1;  return i + 1;
1159  }  }
1160  #endif /* NOUTF || SUPPORT_PCRE16 */  #endif
   
1161    
1162    
1163  #ifdef SUPPORT_PCRE16  #ifdef SUPPORT_PCRE16
# Line 1142  Note that this function does not object Line 1175  Note that this function does not object
1175  deliberate; it makes it possible to construct UTF-16 strings that are invalid,  deliberate; it makes it possible to construct UTF-16 strings that are invalid,
1176  for the purpose of testing that they are correctly faulted.  for the purpose of testing that they are correctly faulted.
1177    
1178  Patterns to be converted are either plain ASCII or UTF-8; data lines are always  Patterns to be converted are either plain ASCII or UTF-8; data lines are always
1179  in UTF-8 so that values greater than 255 can be handled.  in UTF-8 so that values greater than 255 can be handled.
1180    
1181  Arguments:  Arguments:
# Line 1154  Arguments: Line 1187  Arguments:
1187  Returns:     number of 16-bit data items used (excluding trailing zero)  Returns:     number of 16-bit data items used (excluding trailing zero)
1188               OR -1 if a UTF-8 string is malformed               OR -1 if a UTF-8 string is malformed
1189               OR -2 if a value > 0x10ffff is encountered               OR -2 if a value > 0x10ffff is encountered
1190               OR -3 if a value > 0xffff is encountered when not in UTF mode               OR -3 if a value > 0xffff is encountered when not in UTF mode
1191  */  */
1192    
1193  static int  static int
# Line 1237  pcre_uint8 *here = start; Line 1270  pcre_uint8 *here = start;
1270    
1271  for (;;)  for (;;)
1272    {    {
1273    int rlen = (int)(buffer_size - (here - buffer));    size_t rlen = (size_t)(buffer_size - (here - buffer));
1274    
1275    if (rlen > 1000)    if (rlen > 1000)
1276      {      {
# Line 1511  pcre_uint16 *npp = *pp; Line 1544  pcre_uint16 *npp = *pp;
1544  while (isalnum(*p)) *npp++ = *p++;  while (isalnum(*p)) *npp++ = *p++;
1545  *npp++ = 0;  *npp++ = 0;
1546  *npp = 0;  *npp = 0;
1547  if (pcre16_get_stringnumber(re, (PCRE_SPTR16)(*pp)) < 0)  if (pcre16_get_stringnumber((pcre16 *)re, (PCRE_SPTR16)(*pp)) < 0)
1548    {    {
1549    fprintf(outfile, "no parentheses with name \"");    fprintf(outfile, "no parentheses with name \"");
1550    PCHARSV(*pp, 0, -1, outfile);    PCHARSV(*pp, 0, -1, outfile);
# Line 1700  int rc; Line 1733  int rc;
1733    
1734  if (use_pcre16)  if (use_pcre16)
1735  #ifdef SUPPORT_PCRE16  #ifdef SUPPORT_PCRE16
1736    rc = pcre16_fullinfo(re, study, option, ptr);    rc = pcre16_fullinfo((pcre16 *)re, (pcre16_extra *)study, option, ptr);
1737  #else  #else
1738    rc = PCRE_ERROR_BADMODE;    rc = PCRE_ERROR_BADMODE;
1739  #endif  #endif
# Line 1769  architecture. */ Line 1802  architecture. */
1802  static void  static void
1803  regexflip(pcre *ere, pcre_extra *extra)  regexflip(pcre *ere, pcre_extra *extra)
1804  {  {
1805  real_pcre *re = (real_pcre *)ere;  REAL_PCRE *re = (REAL_PCRE *)ere;
1806  #ifdef SUPPORT_PCRE16  #ifdef SUPPORT_PCRE16
1807  int op;  int op;
1808  pcre_uint16 *ptr = (pcre_uint16 *)re + re->name_table_offset;  pcre_uint16 *ptr = (pcre_uint16 *)re + re->name_table_offset;
# Line 1913  while(TRUE) Line 1946  while(TRUE)
1946      break;      break;
1947    
1948      case OP_XCLASS:      case OP_XCLASS:
1949        /* LINK_SIZE can be 1 or 2 in 16 bit mode. */
1950        if (LINK_SIZE > 1)
1951          length = (int)((((unsigned int)(ptr[0]) << 16) | (unsigned int)(ptr[1]))
1952            - (1 + LINK_SIZE + 1));
1953        else
1954          length = (int)((unsigned int)(ptr[0]) - (1 + LINK_SIZE + 1));
1955    
1956      /* Reverse the size of the XCLASS instance. */      /* Reverse the size of the XCLASS instance. */
     ptr++;  
1957      *ptr = swap_uint16(*ptr);      *ptr = swap_uint16(*ptr);
1958        ptr++;
1959      if (LINK_SIZE > 1)      if (LINK_SIZE > 1)
1960        {        {
       /* LINK_SIZE can be 1 or 2 in 16 bit mode. */  
       ptr++;  
1961        *ptr = swap_uint16(*ptr);        *ptr = swap_uint16(*ptr);
1962          ptr++;
1963        }        }
     ptr++;  
   
     if (LINK_SIZE > 1)  
       length = ((ptr[-LINK_SIZE] << 16) | ptr[-LINK_SIZE + 1]) -  
         (1 + LINK_SIZE + 1);  
     else  
       length = ptr[-LINK_SIZE] - (1 + LINK_SIZE + 1);  
1964    
1965      op = *ptr;      op = *ptr;
1966      *ptr = swap_uint16(op);      *ptr = swap_uint16(op);
1967        ptr++;
1968      if ((op & XCL_MAP) != 0)      if ((op & XCL_MAP) != 0)
1969        {        {
1970        /* Skip the character bit map. */        /* Skip the character bit map. */
# Line 2070  printf("This version of pcretest is not Line 2103  printf("This version of pcretest is not
2103  #endif  #endif
2104  printf("\nOptions:\n");  printf("\nOptions:\n");
2105  #ifdef SUPPORT_PCRE16  #ifdef SUPPORT_PCRE16
2106  printf("  -16      use 16-bit interface\n");  printf("  -16      use the 16-bit library\n");
2107  #endif  #endif
2108  printf("  -b       show compiled code (bytecode)\n");  printf("  -b       show compiled code\n");
2109  printf("  -C       show PCRE compile-time options and exit\n");  printf("  -C       show PCRE compile-time options and exit\n");
2110  printf("  -C arg   show a specific compile-time option\n");  printf("  -C arg   show a specific compile-time option\n");
2111  printf("           and exit with its value. The arg can be:\n");  printf("           and exit with its value. The arg can be:\n");
# Line 2082  printf("     pcre16       16 bit library Line 2115  printf("     pcre16       16 bit library
2115  printf("     utf          Unicode Transformation Format supported [0, 1]\n");  printf("     utf          Unicode Transformation Format supported [0, 1]\n");
2116  printf("     ucp          Unicode Properties supported [0, 1]\n");  printf("     ucp          Unicode Properties supported [0, 1]\n");
2117  printf("     jit          Just-in-time compiler supported [0, 1]\n");  printf("     jit          Just-in-time compiler supported [0, 1]\n");
2118    printf("     newline      Newline type [CR, LF, CRLF, ANYCRLF, ANY, ???]\n");
2119  printf("  -d       debug: show compiled code and information (-b and -i)\n");  printf("  -d       debug: show compiled code and information (-b and -i)\n");
2120  #if !defined NODFA  #if !defined NODFA
2121  printf("  -dfa     force DFA matching for all subjects\n");  printf("  -dfa     force DFA matching for all subjects\n");
# Line 2147  pcre_jit_stack *jit_stack = NULL; Line 2181  pcre_jit_stack *jit_stack = NULL;
2181  substring names, each list itself being terminated by an empty name. Assume  substring names, each list itself being terminated by an empty name. Assume
2182  that 1024 is plenty long enough for the few names we'll be testing. It is  that 1024 is plenty long enough for the few names we'll be testing. It is
2183  easiest to keep separate 8-bit and 16-bit versions, using the 16-bit version  easiest to keep separate 8-bit and 16-bit versions, using the 16-bit version
2184  for the actual memory, to ensure alignment. By defining these variables always  for the actual memory, to ensure alignment. */
 (whether or not 8-bit or 16-bit is supported), we avoid too much mess with  
 #ifdefs in the code. */  
2185    
2186  pcre_uint16 copynames[1024];  pcre_uint16 copynames[1024];
2187  pcre_uint16 getnames[1024];  pcre_uint16 getnames[1024];
2188    
2189    #ifdef SUPPORT_PCRE16
2190  pcre_uint16 *cn16ptr;  pcre_uint16 *cn16ptr;
2191  pcre_uint16 *gn16ptr;  pcre_uint16 *gn16ptr;
2192    #endif
2193    
2194    #ifdef SUPPORT_PCRE8
2195  pcre_uint8 *copynames8 = (pcre_uint8 *)copynames;  pcre_uint8 *copynames8 = (pcre_uint8 *)copynames;
2196  pcre_uint8 *getnames8 = (pcre_uint8 *)getnames;  pcre_uint8 *getnames8 = (pcre_uint8 *)getnames;
2197  pcre_uint8 *cn8ptr;  pcre_uint8 *cn8ptr;
2198  pcre_uint8 *gn8ptr;  pcre_uint8 *gn8ptr;
2199    #endif
2200    
2201  /* Get buffers from malloc() so that valgrind will check their misuse when  /* Get buffers from malloc() so that valgrind will check their misuse when
2202  debugging. They grow automatically when very long lines are read. The 16-bit  debugging. They grow automatically when very long lines are read. The 16-bit
# Line 2331  while (argc > 1 && argv[op][0] == '-') Line 2367  while (argc > 1 && argv[op][0] == '-')
2367          yield = rc;          yield = rc;
2368          goto EXIT;          goto EXIT;
2369          }          }
2370        printf("Unknown option: %s\n", argv[op + 1]);        if (strcmp(argv[op + 1], "newline") == 0)
2371            {
2372            (void)PCRE_CONFIG(PCRE_CONFIG_NEWLINE, &rc);
2373            /* Note that these values are always the ASCII values, even
2374            in EBCDIC environments. CR is 13 and NL is 10. */
2375            printf("%s\n", (rc == 13)? "CR" :
2376              (rc == 10)? "LF" : (rc == (13<<8 | 10))? "CRLF" :
2377              (rc == -2)? "ANYCRLF" :
2378              (rc == -1)? "ANY" : "???");
2379            goto EXIT;
2380            }
2381          printf("Unknown -C option: %s\n", argv[op + 1]);
2382        goto EXIT;        goto EXIT;
2383        }        }
2384    
# Line 2362  are set, either both UTFs are supported Line 2409  are set, either both UTFs are supported
2409      printf("  %sUnicode properties support\n", rc? "" : "No ");      printf("  %sUnicode properties support\n", rc? "" : "No ");
2410      (void)PCRE_CONFIG(PCRE_CONFIG_JIT, &rc);      (void)PCRE_CONFIG(PCRE_CONFIG_JIT, &rc);
2411      if (rc)      if (rc)
2412        printf("  Just-in-time compiler support\n");        {
2413          const char *arch;
2414          (void)PCRE_CONFIG(PCRE_CONFIG_JITTARGET, (void *)(&arch));
2415          printf("  Just-in-time compiler support: %s\n", arch);
2416          }
2417      else      else
2418        printf("  No just-in-time compiler support\n");        printf("  No just-in-time compiler support\n");
2419      (void)PCRE_CONFIG(PCRE_CONFIG_NEWLINE, &rc);      (void)PCRE_CONFIG(PCRE_CONFIG_NEWLINE, &rc);
# Line 2384  are set, either both UTFs are supported Line 2435  are set, either both UTFs are supported
2435      (void)PCRE_CONFIG(PCRE_CONFIG_MATCH_LIMIT_RECURSION, &lrc);      (void)PCRE_CONFIG(PCRE_CONFIG_MATCH_LIMIT_RECURSION, &lrc);
2436      printf("  Default recursion depth limit = %ld\n", lrc);      printf("  Default recursion depth limit = %ld\n", lrc);
2437      (void)PCRE_CONFIG(PCRE_CONFIG_STACKRECURSE, &rc);      (void)PCRE_CONFIG(PCRE_CONFIG_STACKRECURSE, &rc);
2438      printf("  Match recursion uses %s\n", rc? "stack" : "heap");      printf("  Match recursion uses %s", rc? "stack" : "heap");
2439        if (showstore)
2440          {
2441          PCRE_EXEC(stack_size, NULL, NULL, NULL, -999, -999, 0, NULL, 0);
2442          printf(": %sframe size = %d bytes", rc? "approximate " : "", -stack_size);
2443          }
2444        printf("\n");
2445      goto EXIT;      goto EXIT;
2446      }      }
2447    else if (strcmp(argv[op], "-help") == 0 ||    else if (strcmp(argv[op], "-help") == 0 ||
# Line 2477  while (!done) Line 2534  while (!done)
2534    pcre_uint8 *p, *pp, *ppp;    pcre_uint8 *p, *pp, *ppp;
2535    pcre_uint8 *to_file = NULL;    pcre_uint8 *to_file = NULL;
2536    const pcre_uint8 *tables = NULL;    const pcre_uint8 *tables = NULL;
2537      unsigned long int get_options;
2538    unsigned long int true_size, true_study_size = 0;    unsigned long int true_size, true_study_size = 0;
2539    size_t size, regex_gotten_store;    size_t size, regex_gotten_store;
2540    int do_allcaps = 0;    int do_allcaps = 0;
# Line 2507  while (!done) Line 2565  while (!done)
2565    
2566    if (*p == '<' && strchr((char *)(p+1), '<') == NULL)    if (*p == '<' && strchr((char *)(p+1), '<') == NULL)
2567      {      {
2568      unsigned long int magic, get_options;      pcre_uint32 magic;
2569      pcre_uint8 sbuf[8];      pcre_uint8 sbuf[8];
2570      FILE *f;      FILE *f;
2571    
2572      p++;      p++;
2573        if (*p == '!')
2574          {
2575          do_debug = TRUE;
2576          do_showinfo = TRUE;
2577          p++;
2578          }
2579    
2580      pp = p + (int)strlen((char *)p);      pp = p + (int)strlen((char *)p);
2581      while (isspace(pp[-1])) pp--;      while (isspace(pp[-1])) pp--;
2582      *pp = 0;      *pp = 0;
# Line 2523  while (!done) Line 2588  while (!done)
2588        continue;        continue;
2589        }        }
2590    
2591        first_gotten_store = 0;
2592      if (fread(sbuf, 1, 8, f) != 8) goto FAIL_READ;      if (fread(sbuf, 1, 8, f) != 8) goto FAIL_READ;
2593    
2594      true_size =      true_size =
# Line 2530  while (!done) Line 2596  while (!done)
2596      true_study_size =      true_study_size =
2597        (sbuf[4] << 24) | (sbuf[5] << 16) | (sbuf[6] << 8) | sbuf[7];        (sbuf[4] << 24) | (sbuf[5] << 16) | (sbuf[6] << 8) | sbuf[7];
2598    
2599      re = (real_pcre *)new_malloc(true_size);      re = (pcre *)new_malloc(true_size);
2600      regex_gotten_store = first_gotten_store;      regex_gotten_store = first_gotten_store;
2601    
2602      if (fread(re, 1, true_size, f) != true_size) goto FAIL_READ;      if (fread(re, 1, true_size, f) != true_size) goto FAIL_READ;
2603    
2604      magic = ((real_pcre *)re)->magic_number;      magic = ((REAL_PCRE *)re)->magic_number;
2605      if (magic != MAGIC_NUMBER)      if (magic != MAGIC_NUMBER)
2606        {        {
2607        if (swap_uint32(magic) == MAGIC_NUMBER)        if (swap_uint32(magic) == MAGIC_NUMBER)
# Line 2550  while (!done) Line 2616  while (!done)
2616          }          }
2617        }        }
2618    
2619        /* We hide the byte-invert info for little and big endian tests. */
2620      fprintf(outfile, "Compiled pattern%s loaded from %s\n",      fprintf(outfile, "Compiled pattern%s loaded from %s\n",
2621        do_flip? " (byte-inverted)" : "", p);        do_flip && (p[-1] == '<') ? " (byte-inverted)" : "", p);
2622    
2623      /* Now see if there is any following study data. */      /* Now see if there is any following study data. */
2624    
# Line 2585  while (!done) Line 2652  while (!done)
2652      /* Flip the necessary bytes. */      /* Flip the necessary bytes. */
2653      if (do_flip)      if (do_flip)
2654        {        {
2655        PCRE_PATTERN_TO_HOST_BYTE_ORDER(re, extra, NULL);        int rc;
2656          PCRE_PATTERN_TO_HOST_BYTE_ORDER(rc, re, extra, NULL);
2657          if (rc == PCRE_ERROR_BADMODE)
2658            {
2659            /* Simulate the result of the function call below. */
2660            fprintf(outfile, "Error %d from pcre%s_fullinfo(%d)\n", rc,
2661              use_pcre16? "16" : "", PCRE_INFO_OPTIONS);
2662            fprintf(outfile, "Running in %s-bit mode but pattern was compiled in "
2663              "%s-bit mode\n", use_pcre16? "16":"8", use_pcre16? "8":"16");
2664            continue;
2665            }
2666        }        }
2667    
2668      /* Need to know if UTF-8 for printing data strings. */      /* Need to know if UTF-8 for printing data strings. */
# Line 2818  while (!done) Line 2895  while (!done)
2895  #endif  /* !defined NOPOSIX */  #endif  /* !defined NOPOSIX */
2896    
2897      {      {
     unsigned long int get_options;  
   
2898      /* In 16-bit mode, convert the input. */      /* In 16-bit mode, convert the input. */
2899    
2900  #ifdef SUPPORT_PCRE16  #ifdef SUPPORT_PCRE16
# Line 2836  while (!done) Line 2911  while (!done)
2911          fprintf(outfile, "**Failed: character value greater than 0x10ffff "          fprintf(outfile, "**Failed: character value greater than 0x10ffff "
2912            "cannot be converted to UTF-16\n");            "cannot be converted to UTF-16\n");
2913          goto SKIP_DATA;          goto SKIP_DATA;
2914    
2915          case -3: /* "Impossible error" when to16 is called arg1 FALSE */          case -3: /* "Impossible error" when to16 is called arg1 FALSE */
2916          fprintf(outfile, "**Failed: character value greater than 0xffff "          fprintf(outfile, "**Failed: character value greater than 0xffff "
2917            "cannot be converted to 16-bit in non-UTF mode\n");            "cannot be converted to 16-bit in non-UTF mode\n");
2918          goto SKIP_DATA;          goto SKIP_DATA;
2919    
2920          default:          default:
2921          break;          break;
# Line 2906  while (!done) Line 2981  while (!done)
2981      /* Extract the size for possible writing before possibly flipping it,      /* Extract the size for possible writing before possibly flipping it,
2982      and remember the store that was got. */      and remember the store that was got. */
2983    
2984      true_size = ((real_pcre *)re)->size;      true_size = ((REAL_PCRE *)re)->size;
2985      regex_gotten_store = first_gotten_store;      regex_gotten_store = first_gotten_store;
2986    
2987      /* Output code size information if requested */      /* Output code size information if requested */
# Line 2914  while (!done) Line 2989  while (!done)
2989      if (log_store)      if (log_store)
2990        fprintf(outfile, "Memory allocation (code space): %d\n",        fprintf(outfile, "Memory allocation (code space): %d\n",
2991          (int)(first_gotten_store -          (int)(first_gotten_store -
2992                sizeof(real_pcre) -                sizeof(REAL_PCRE) -
2993                ((real_pcre *)re)->name_count * ((real_pcre *)re)->name_entry_size));                ((REAL_PCRE *)re)->name_count * ((REAL_PCRE *)re)->name_entry_size));
2994    
2995      /* If -s or /S was present, study the regex to generate additional info to      /* If -s or /S was present, study the regex to generate additional info to
2996      help with the matching, unless the pattern has the SS option, which      help with the matching, unless the pattern has the SS option, which
# Line 3046  while (!done) Line 3121  while (!done)
3121        if (!okpartial) fprintf(outfile, "Partial matching not supported\n");        if (!okpartial) fprintf(outfile, "Partial matching not supported\n");
3122        if (hascrorlf) fprintf(outfile, "Contains explicit CR or LF match\n");        if (hascrorlf) fprintf(outfile, "Contains explicit CR or LF match\n");
3123    
3124        all_options = ((real_pcre *)re)->options;        all_options = ((REAL_PCRE *)re)->options;
3125        if (do_flip) all_options = swap_uint32(all_options);        if (do_flip) all_options = swap_uint32(all_options);
3126    
3127        if (get_options == 0) fprintf(outfile, "No options\n");        if (get_options == 0) fprintf(outfile, "No options\n");
# Line 3108  while (!done) Line 3183  while (!done)
3183        else        else
3184          {          {
3185          const char *caseless =          const char *caseless =
3186            ((((real_pcre *)re)->flags & PCRE_FCH_CASELESS) == 0)?            ((((REAL_PCRE *)re)->flags & PCRE_FCH_CASELESS) == 0)?
3187            "" : " (caseless)";            "" : " (caseless)";
3188    
3189          if (PRINTOK(first_char))          if (PRINTOK(first_char))
# Line 3128  while (!done) Line 3203  while (!done)
3203        else        else
3204          {          {
3205          const char *caseless =          const char *caseless =
3206            ((((real_pcre *)re)->flags & PCRE_RCH_CASELESS) == 0)?            ((((REAL_PCRE *)re)->flags & PCRE_RCH_CASELESS) == 0)?
3207            "" : " (caseless)";            "" : " (caseless)";
3208    
3209          if (PRINTOK(need_char))          if (PRINTOK(need_char))
# Line 3305  while (!done) Line 3380  while (!done)
3380      *copynames = 0;      *copynames = 0;
3381      *getnames = 0;      *getnames = 0;
3382    
3383    #ifdef SUPPORT_PCRE16
3384      cn16ptr = copynames;      cn16ptr = copynames;
3385      gn16ptr = getnames;      gn16ptr = getnames;
3386    #endif
3387    #ifdef SUPPORT_PCRE8
3388      cn8ptr = copynames8;      cn8ptr = copynames8;
3389      gn8ptr = getnames8;      gn8ptr = getnames8;
3390    #endif
3391    
3392      SET_PCRE_CALLOUT(callout);      SET_PCRE_CALLOUT(callout);
3393      first_callout = 1;      first_callout = 1;
# Line 3353  while (!done) Line 3432  while (!done)
3432        {        {
3433        int i = 0;        int i = 0;
3434        int n = 0;        int n = 0;
3435    
3436        /* In UTF mode, input can be UTF-8, so just copy all non-backslash bytes.        /* In UTF mode, input can be UTF-8, so just copy all non-backslash bytes.
3437        In non-UTF mode, allow the value of the byte to fall through to later,        In non-UTF mode, allow the value of the byte to fall through to later,
3438        where values greater than 127 are turned into UTF-8 when running in        where values greater than 127 are turned into UTF-8 when running in
3439        16-bit mode. */        16-bit mode. */
3440    
3441        if (c != '\\')        if (c != '\\')
3442          {          {
3443          if (use_utf)          if (use_utf)
3444            {            {
3445            *q++ = c;            *q++ = c;
3446            continue;            continue;
3447            }            }
3448          }          }
3449    
3450        /* Handle backslash escapes */        /* Handle backslash escapes */
3451    
3452        else switch ((c = *p++))        else switch ((c = *p++))
3453          {          {
3454          case 'a': c =    7; break;          case 'a': c =    7; break;
# Line 3400  while (!done) Line 3479  while (!done)
3479            least one MacOS environment. */            least one MacOS environment. */
3480    
3481            for (pt++; isxdigit(*pt); pt++)            for (pt++; isxdigit(*pt); pt++)
3482              c = c * 16 + tolower(*pt) - ((isdigit(*pt))? '0' : 'a' - 10);              {
3483                if (++i == 9)
3484                  fprintf(outfile, "** Too many hex digits in \\x{...} item; "
3485                                   "using only the first eight.\n");
3486                else c = c * 16 + tolower(*pt) - ((isdigit(*pt))? '0' : 'a' - 10);
3487                }
3488            if (*pt == '}')            if (*pt == '}')
3489              {              {
3490              p = pt + 1;              p = pt + 1;
# Line 3409  while (!done) Line 3493  while (!done)
3493            /* Not correct form for \x{...}; fall through */            /* Not correct form for \x{...}; fall through */
3494            }            }
3495    
3496          /* \x without {} always defines just one byte in 8-bit mode. This          /* \x without {} always defines just one byte in 8-bit mode. This
3497          allows UTF-8 characters to be constructed byte by byte, and also allows          allows UTF-8 characters to be constructed byte by byte, and also allows
3498          invalid UTF-8 sequences to be made. Just copy the byte in UTF mode.          invalid UTF-8 sequences to be made. Just copy the byte in UTF mode.
3499          Otherwise, pass it down to later code so that it can be turned into          Otherwise, pass it down to later code so that it can be turned into
3500          UTF-8 when running in 16-bit mode. */          UTF-8 when running in 16-bit mode. */
3501    
3502          c = 0;          c = 0;
# Line 3422  while (!done) Line 3506  while (!done)
3506            p++;            p++;
3507            }            }
3508          if (use_utf)          if (use_utf)
3509            {            {
3510            *q++ = c;            *q++ = c;
3511            continue;            continue;
3512            }            }
3513          break;          break;
3514    
3515          case 0:   /* \ followed by EOF allows for an empty line */          case 0:   /* \ followed by EOF allows for an empty line */
# Line 3531  while (!done) Line 3615  while (!done)
3615              && (extra->flags & PCRE_EXTRA_EXECUTABLE_JIT) != 0              && (extra->flags & PCRE_EXTRA_EXECUTABLE_JIT) != 0
3616              && extra->executable_jit != NULL)              && extra->executable_jit != NULL)
3617            {            {
3618            if (jit_stack != NULL) PCRE_JIT_STACK_FREE(jit_stack);            if (jit_stack != NULL) { PCRE_JIT_STACK_FREE(jit_stack); }
3619            jit_stack = PCRE_JIT_STACK_ALLOC(1, n * 1024);            jit_stack = PCRE_JIT_STACK_ALLOC(1, n * 1024);
3620            PCRE_ASSIGN_JIT_STACK(extra, jit_callback, jit_stack);            PCRE_ASSIGN_JIT_STACK(extra, jit_callback, jit_stack);
3621            }            }
# Line 3630  while (!done) Line 3714  while (!done)
3714          continue;          continue;
3715          }          }
3716    
3717        /* We now have a character value in c that may be greater than 255. In        /* We now have a character value in c that may be greater than 255. In
3718        16-bit mode, we always convert characters to UTF-8 so that values greater        16-bit mode, we always convert characters to UTF-8 so that values greater
3719        than 255 can be passed to non-UTF 16-bit strings. In 8-bit mode we        than 255 can be passed to non-UTF 16-bit strings. In 8-bit mode we
3720        convert to UTF-8 if we are in UTF mode. Values greater than 127 in UTF        convert to UTF-8 if we are in UTF mode. Values greater than 127 in UTF
3721        mode must have come from \x{...} or octal constructs because values from        mode must have come from \x{...} or octal constructs because values from
3722        \x.. get this far only in non-UTF mode. */        \x.. get this far only in non-UTF mode. */
3723    
3724    #if !defined NOUTF || defined SUPPORT_PCRE16
3725        if (use_pcre16 || use_utf)        if (use_pcre16 || use_utf)
3726          {          {
3727          pcre_uint8 buff8[8];          pcre_uint8 buff8[8];
# Line 3645  while (!done) Line 3730  while (!done)
3730          for (ii = 0; ii < utn; ii++) *q++ = buff8[ii];          for (ii = 0; ii < utn; ii++) *q++ = buff8[ii];
3731          }          }
3732        else        else
3733    #endif
3734          {          {
3735          if (c > 255)          if (c > 255)
3736            {            {
# Line 3656  while (!done) Line 3742  while (!done)
3742          *q++ = c;          *q++ = c;
3743          }          }
3744        }        }
3745    
3746      /* Reached end of subject string */      /* Reached end of subject string */
3747    
3748      *q = 0;      *q = 0;
3749      len = (int)(q - dbuffer);      len = (int)(q - dbuffer);
3750    
# Line 3744  while (!done) Line 3830  while (!done)
3830  #ifdef SUPPORT_PCRE16  #ifdef SUPPORT_PCRE16
3831      if (use_pcre16)      if (use_pcre16)
3832        {        {
3833        len = to16(TRUE, bptr, (((real_pcre *)re)->options) & PCRE_UTF8, len);        len = to16(TRUE, bptr, (((REAL_PCRE *)re)->options) & PCRE_UTF8, len);
3834        switch(len)        switch(len)
3835          {          {
3836          case -1:          case -1:
# Line 3760  while (!done) Line 3846  while (!done)
3846          case -3:          case -3:
3847          fprintf(outfile, "**Failed: character value greater than 0xffff "          fprintf(outfile, "**Failed: character value greater than 0xffff "
3848            "cannot be converted to 16-bit in non-UTF mode\n");            "cannot be converted to 16-bit in non-UTF mode\n");
3849          goto NEXT_DATA;          goto NEXT_DATA;
3850    
3851          default:          default:
3852          break;          break;
# Line 4124  while (!done) Line 4210  while (!done)
4210          if (g_notempty != 0)          if (g_notempty != 0)
4211            {            {
4212            int onechar = 1;            int onechar = 1;
4213            unsigned int obits = ((real_pcre *)re)->options;            unsigned int obits = ((REAL_PCRE *)re)->options;
4214            use_offsets[0] = start_offset;            use_offsets[0] = start_offset;
4215            if ((obits & PCRE_NEWLINE_BITS) == 0)            if ((obits & PCRE_NEWLINE_BITS) == 0)
4216              {              {
# Line 4206  while (!done) Line 4292  while (!done)
4292              break;              break;
4293    
4294              default:              default:
4295              if (count < 0 && (-count) < sizeof(errtexts)/sizeof(const char *))              if (count < 0 &&
4296                    (-count) < (int)(sizeof(errtexts)/sizeof(const char *)))
4297                fprintf(outfile, "Error %d (%s)\n", count, errtexts[-count]);                fprintf(outfile, "Error %d (%s)\n", count, errtexts[-count]);
4298              else              else
4299                fprintf(outfile, "Error %d (Unexpected value)\n", count);                fprintf(outfile, "Error %d (Unexpected value)\n", count);

Legend:
Removed from v.836  
changed lines
  Added in v.908

  ViewVC Help
Powered by ViewVC 1.1.5