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

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

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

revision 817 by zherczeg, Thu Dec 22 07:03:34 2011 UTC revision 818 by ph10, Thu Dec 22 20:11:31 2011 UTC
# Line 162  Makefile. */ Line 162  Makefile. */
162    
163  /* It is also possible, originally for the benefit of a version that was  /* It is also possible, originally for the benefit of a version that was
164  imported into Exim, to build pcretest without support for UTF8 (define NOUTF8),  imported into Exim, to build pcretest without support for UTF8 (define NOUTF8),
165  without the interface to the DFA matcher (NODFA), and without the doublecheck  without the interface to the DFA matcher (NODFA). In fact, we automatically cut
 of the old "info" function (define NOINFOCHECK). In fact, we automatically cut  
166  out the UTF8 support if PCRE is built without it. */  out the UTF8 support if PCRE is built without it. */
167    
168  #ifndef SUPPORT_UTF8  #ifndef SUPPORT_UTF8
# Line 188  use these in the definitions of generic Line 187  use these in the definitions of generic
187  #define PCHARSV8(p, len, f) \  #define PCHARSV8(p, len, f) \
188    (void)pchars((pcre_uint8 *)p, len, f)    (void)pchars((pcre_uint8 *)p, len, f)
189    
190    #define SET_PCRE_CALLOUT8(callout) \
191      pcre_callout = callout
192    
193  #define STRLEN8(p) ((int)strlen((char *)p))  #define STRLEN8(p) ((int)strlen((char *)p))
194    
195    
196  #define PCRE_COMPILE8(re, pat, options, error, erroffset, tables) \  #define PCRE_COMPILE8(re, pat, options, error, erroffset, tables) \
197    re = pcre_compile((char *)pat, options, error, erroffset, tables)    re = pcre_compile((char *)pat, options, error, erroffset, tables)
198    
# Line 237  use these in the definitions of generic Line 240  use these in the definitions of generic
240  #define PCRE_PATTERN_TO_HOST_BYTE_ORDER8(re, extra, tables) \  #define PCRE_PATTERN_TO_HOST_BYTE_ORDER8(re, extra, tables) \
241    pcre_pattern_to_host_byte_order(re, extra, tables)    pcre_pattern_to_host_byte_order(re, extra, tables)
242    
243    #define PCRE_PRINTINT8(re, outfile, debug_lengths) \
244      pcre_printint(re, outfile, debug_lengths)
245    
246  #define PCRE_STUDY8(extra, re, options, error) \  #define PCRE_STUDY8(extra, re, options, error) \
247    extra = pcre_study(re, options, error)    extra = pcre_study(re, options, error)
248    
 #define SET_PCRE_CALLOUT8(callout) \  
   pcre_callout = callout  
   
249  #endif /* SUPPORT_PCRE8 */  #endif /* SUPPORT_PCRE8 */
250    
251  /* -----------------------------------------------------------*/  /* -----------------------------------------------------------*/
# Line 257  use these in the definitions of generic Line 260  use these in the definitions of generic
260    
261  #define STRLEN16(p) ((int)strlen16((PCRE_SPTR16)p))  #define STRLEN16(p) ((int)strlen16((PCRE_SPTR16)p))
262    
263    #define SET_PCRE_CALLOUT16(callout) \
264      pcre16_callout = callout
265    
266    
267  #define PCRE_COMPILE16(re, pat, options, error, erroffset, tables) \  #define PCRE_COMPILE16(re, pat, options, error, erroffset, tables) \
268    re = pcre16_compile((PCRE_SPTR16)pat, options, error, erroffset, tables)    re = pcre16_compile((PCRE_SPTR16)pat, options, error, erroffset, tables)
269    
# Line 307  use these in the definitions of generic Line 314  use these in the definitions of generic
314  #define PCRE_PATTERN_TO_HOST_BYTE_ORDER16(re, extra, tables) \  #define PCRE_PATTERN_TO_HOST_BYTE_ORDER16(re, extra, tables) \
315    pcre16_pattern_to_host_byte_order(re, extra, tables)    pcre16_pattern_to_host_byte_order(re, extra, tables)
316    
317    #define PCRE_PRINTINT16(re, outfile, debug_lengths) \
318      pcre16_printint(re, outfile, debug_lengths)
319    
320  #define PCRE_STUDY16(extra, re, options, error) \  #define PCRE_STUDY16(extra, re, options, error) \
321    extra = pcre16_study(re, options, error)    extra = pcre16_study(re, options, error)
322    
 #define SET_PCRE_CALLOUT16(callout) \  
   pcre16_callout = callout  
   
323  #endif /* SUPPORT_PCRE16 */  #endif /* SUPPORT_PCRE16 */
324    
325    
326  /* ----- Both modes are supported; a runtime test is needed ----- */  /* ----- Both modes are supported; a runtime test is needed, except for
327    pcre_config(), and the JIT stack functions, when it doesn't matter which
328    version is called. ----- */
329    
330  #if defined SUPPORT_PCRE8 && defined SUPPORT_PCRE16  #if defined SUPPORT_PCRE8 && defined SUPPORT_PCRE16
331    
# Line 334  use these in the definitions of generic Line 343  use these in the definitions of generic
343    else \    else \
344      PCHARSV8(p, len, f)      PCHARSV8(p, len, f)
345    
346    #define SET_PCRE_CALLOUT(callout) \
347      if (use_pcre16) \
348        SET_PCRE_CALLOUT16(callout); \
349      else \
350        SET_PCRE_CALLOUT8(callout)
351    
352  #define STRLEN(p) (use_pcre16? STRLEN16(p) : STRLEN8(p))  #define STRLEN(p) (use_pcre16? STRLEN16(p) : STRLEN8(p))
353    
354    #define PCRE_ASSIGN_JIT_STACK pcre_assign_jit_stack
355    
356  #define PCRE_COMPILE(re, pat, options, error, erroffset, tables) \  #define PCRE_COMPILE(re, pat, options, error, erroffset, tables) \
357    if (use_pcre16) \    if (use_pcre16) \
358      PCRE_COMPILE16(re, pat, options, error, erroffset, tables); \      PCRE_COMPILE16(re, pat, options, error, erroffset, tables); \
359    else \    else \
360      PCRE_COMPILE8(re, pat, options, error, erroffset, tables)      PCRE_COMPILE8(re, pat, options, error, erroffset, tables)
361    
362    #define PCRE_CONFIG pcre_config
363    
364  #define PCRE_COPY_NAMED_SUBSTRING(rc, re, bptr, offsets, count, \  #define PCRE_COPY_NAMED_SUBSTRING(rc, re, bptr, offsets, count, \
365      namesptr, cbuffer, size) \      namesptr, cbuffer, size) \
# Line 420  use these in the definitions of generic Line 439  use these in the definitions of generic
439    else \    else \
440      PCRE_GET_SUBSTRING_LIST8(rc, bptr, offsets, count, listptr)      PCRE_GET_SUBSTRING_LIST8(rc, bptr, offsets, count, listptr)
441    
442    #define PCRE_JIT_STACK_ALLOC pcre_jit_stack_alloc
443    #define PCRE_JIT_STACK_FREE pcre_jit_stack_free
444    
445    #define PCRE_MAKETABLES \
446      (use_pcre16? pcre16_maketables() : pcre_maketables())
447    
448  #define PCRE_PATTERN_TO_HOST_BYTE_ORDER(re, extra, tables) \  #define PCRE_PATTERN_TO_HOST_BYTE_ORDER(re, extra, tables) \
449    if (use_pcre16) \    if (use_pcre16) \
450      PCRE_PATTERN_TO_HOST_BYTE_ORDER16(re, extra, tables); \      PCRE_PATTERN_TO_HOST_BYTE_ORDER16(re, extra, tables); \
451    else \    else \
452      PCRE_PATTERN_TO_HOST_BYTE_ORDER8(re, extra, tables)      PCRE_PATTERN_TO_HOST_BYTE_ORDER8(re, extra, tables)
453    
454  #define PCRE_STUDY(extra, re, options, error) \  #define PCRE_PRINTINT(re, outfile, debug_lengths) \
455    if (use_pcre16) \    if (use_pcre16) \
456      PCRE_STUDY16(extra, re, options, error); \      PCRE_PRINTINT16(re, outfile, debug_lengths); \
457    else \    else \
458      PCRE_STUDY8(extra, re, options, error)      PCRE_PRINTINT8(re, outfile, debug_lengths)
459    
460  #define SET_PCRE_CALLOUT(callout) \  #define PCRE_STUDY(extra, re, options, error) \
461    if (use_pcre16) \    if (use_pcre16) \
462      SET_PCRE_CALLOUT16(callout); \      PCRE_STUDY16(extra, re, options, error); \
463    else \    else \
464      SET_PCRE_CALLOUT8(callout)      PCRE_STUDY8(extra, re, options, error)
465    
466  /* ----- Only 8-bit mode is supported ----- */  /* ----- Only 8-bit mode is supported ----- */
467    
# Line 444  use these in the definitions of generic Line 469  use these in the definitions of generic
469  #define CHAR_SIZE                 1  #define CHAR_SIZE                 1
470  #define PCHARS                    PCHARS8  #define PCHARS                    PCHARS8
471  #define PCHARSV                   PCHARSV8  #define PCHARSV                   PCHARSV8
472    #define SET_PCRE_CALLOUT          SET_PCRE_CALLOUT8
473  #define STRLEN                    STRLEN8  #define STRLEN                    STRLEN8
474    #define PCRE_ASSIGN_JIT_STACK     pcre_assign_jit_stack
475  #define PCRE_COMPILE              PCRE_COMPILE8  #define PCRE_COMPILE              PCRE_COMPILE8
476    #define PCRE_CONFIG               pcre_config
477  #define PCRE_COPY_NAMED_SUBSTRING PCRE_COPY_NAMED_SUBSTRING8  #define PCRE_COPY_NAMED_SUBSTRING PCRE_COPY_NAMED_SUBSTRING8
478  #define PCRE_COPY_SUBSTRING       PCRE_COPY_SUBSTRING8  #define PCRE_COPY_SUBSTRING       PCRE_COPY_SUBSTRING8
479  #define PCRE_DFA_EXEC             PCRE_DFA_EXEC8  #define PCRE_DFA_EXEC             PCRE_DFA_EXEC8
# Line 457  use these in the definitions of generic Line 485  use these in the definitions of generic
485  #define PCRE_GET_STRINGNUMBER     PCRE_GET_STRINGNUMBER8  #define PCRE_GET_STRINGNUMBER     PCRE_GET_STRINGNUMBER8
486  #define PCRE_GET_SUBSTRING        PCRE_GET_SUBSTRING8  #define PCRE_GET_SUBSTRING        PCRE_GET_SUBSTRING8
487  #define PCRE_GET_SUBSTRING_LIST   PCRE_GET_SUBSTRING_LIST8  #define PCRE_GET_SUBSTRING_LIST   PCRE_GET_SUBSTRING_LIST8
488    #define PCRE_JIT_STACK_ALLOC      pcre_jit_stack_alloc
489    #define PCRE_JIT_STACK_FREE       pcre_jit_stack_free
490    #define PCRE_MAKETABLES           pcre_maketables()
491  #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
492    #define PCRE_PRINTINT             PCRE_PRINTINT8
493  #define PCRE_STUDY                PCRE_STUDY8  #define PCRE_STUDY                PCRE_STUDY8
 #define SET_PCRE_CALLOUT          SET_PCRE_CALLOUT8  
494    
495  /* ----- Only 16-bit mode is supported ----- */  /* ----- Only 16-bit mode is supported ----- */
496    
# Line 467  use these in the definitions of generic Line 498  use these in the definitions of generic
498  #define CHAR_SIZE                 1  #define CHAR_SIZE                 1
499  #define PCHARS                    PCHARS16  #define PCHARS                    PCHARS16
500  #define PCHARSV                   PCHARSV16  #define PCHARSV                   PCHARSV16
501    #define SET_PCRE_CALLOUT          SET_PCRE_CALLOUT16
502  #define STRLEN                    STRLEN16  #define STRLEN                    STRLEN16
503    #define PCRE_ASSIGN_JIT_STACK     pcre16_assign_jit_stack
504  #define PCRE_COMPILE              PCRE_COMPILE16  #define PCRE_COMPILE              PCRE_COMPILE16
505    #define PCRE_CONFIG               pcre16_config
506  #define PCRE_COPY_NAMED_SUBSTRING PCRE_COPY_NAMED_SUBSTRING16  #define PCRE_COPY_NAMED_SUBSTRING PCRE_COPY_NAMED_SUBSTRING16
507  #define PCRE_COPY_SUBSTRING       PCRE_COPY_SUBSTRING16  #define PCRE_COPY_SUBSTRING       PCRE_COPY_SUBSTRING16
508  #define PCRE_DFA_EXEC             PCRE_DFA_EXEC16  #define PCRE_DFA_EXEC             PCRE_DFA_EXEC16
# Line 480  use these in the definitions of generic Line 514  use these in the definitions of generic
514  #define PCRE_GET_STRINGNUMBER     PCRE_GET_STRINGNUMBER16  #define PCRE_GET_STRINGNUMBER     PCRE_GET_STRINGNUMBER16
515  #define PCRE_GET_SUBSTRING        PCRE_GET_SUBSTRING16  #define PCRE_GET_SUBSTRING        PCRE_GET_SUBSTRING16
516  #define PCRE_GET_SUBSTRING_LIST   PCRE_GET_SUBSTRING_LIST16  #define PCRE_GET_SUBSTRING_LIST   PCRE_GET_SUBSTRING_LIST16
517    #define PCRE_JIT_STACK_ALLOC      pcre16_jit_stack_alloc
518    #define PCRE_JIT_STACK_FREE       pcre16_jit_stack_free
519    #define PCRE_MAKETABLES           pcre16_maketables()
520  #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
521    #define PCRE_PRINTINT             PCRE_PRINTINT16
522  #define PCRE_STUDY                PCRE_STUDY16  #define PCRE_STUDY                PCRE_STUDY16
 #define SET_PCRE_CALLOUT          SET_PCRE_CALLOUT16  
523  #endif  #endif
524    
525  /* ----- End of mode-specific function call macros ----- */  /* ----- End of mode-specific function call macros ----- */
# Line 2029  while (argc > 1 && argv[op][0] == '-') Line 2066  while (argc > 1 && argv[op][0] == '-')
2066      force_study = 1;      force_study = 1;
2067      force_study_options = PCRE_STUDY_JIT_COMPILE;      force_study_options = PCRE_STUDY_JIT_COMPILE;
2068      }      }
2069      else if (strcmp(argv[op], "-16") == 0)
2070        {
2071  #ifdef SUPPORT_PCRE16  #ifdef SUPPORT_PCRE16
2072    else if (strcmp(argv[op], "-16") == 0) use_pcre16 = 1;      use_pcre16 = 1;
2073    #else
2074        printf("** This version of PCRE was built without 16-bit support\n");
2075        exit(1);
2076  #endif  #endif
2077        }
2078    else if (strcmp(argv[op], "-q") == 0) quiet = 1;    else if (strcmp(argv[op], "-q") == 0) quiet = 1;
2079    else if (strcmp(argv[op], "-b") == 0) debug = 1;    else if (strcmp(argv[op], "-b") == 0) debug = 1;
2080    else if (strcmp(argv[op], "-i") == 0) showinfo = 1;    else if (strcmp(argv[op], "-i") == 0) showinfo = 1;
# Line 2114  are set, either both UTFs are supported Line 2156  are set, either both UTFs are supported
2156      printf("  %sUTF-16 support\n", rc? "" : "No ");      printf("  %sUTF-16 support\n", rc? "" : "No ");
2157  #endif  #endif
2158    
2159      (void)pcre_config(PCRE_CONFIG_UNICODE_PROPERTIES, &rc);      (void)PCRE_CONFIG(PCRE_CONFIG_UNICODE_PROPERTIES, &rc);
2160      printf("  %sUnicode properties support\n", rc? "" : "No ");      printf("  %sUnicode properties support\n", rc? "" : "No ");
2161      (void)pcre_config(PCRE_CONFIG_JIT, &rc);      (void)PCRE_CONFIG(PCRE_CONFIG_JIT, &rc);
2162      if (rc)      if (rc)
2163        printf("  Just-in-time compiler support\n");        printf("  Just-in-time compiler support\n");
2164      else      else
2165        printf("  No just-in-time compiler support\n");        printf("  No just-in-time compiler support\n");
2166      (void)pcre_config(PCRE_CONFIG_NEWLINE, &rc);      (void)PCRE_CONFIG(PCRE_CONFIG_NEWLINE, &rc);
2167      /* Note that these values are always the ASCII values, even      /* Note that these values are always the ASCII values, even
2168      in EBCDIC environments. CR is 13 and NL is 10. */      in EBCDIC environments. CR is 13 and NL is 10. */
2169      printf("  Newline sequence is %s\n", (rc == 13)? "CR" :      printf("  Newline sequence is %s\n", (rc == 13)? "CR" :
2170        (rc == 10)? "LF" : (rc == (13<<8 | 10))? "CRLF" :        (rc == 10)? "LF" : (rc == (13<<8 | 10))? "CRLF" :
2171        (rc == -2)? "ANYCRLF" :        (rc == -2)? "ANYCRLF" :
2172        (rc == -1)? "ANY" : "???");        (rc == -1)? "ANY" : "???");
2173      (void)pcre_config(PCRE_CONFIG_BSR, &rc);      (void)PCRE_CONFIG(PCRE_CONFIG_BSR, &rc);
2174      printf("  \\R matches %s\n", rc? "CR, LF, or CRLF only" :      printf("  \\R matches %s\n", rc? "CR, LF, or CRLF only" :
2175                                       "all Unicode newlines");                                       "all Unicode newlines");
2176      (void)pcre_config(PCRE_CONFIG_LINK_SIZE, &rc);      (void)PCRE_CONFIG(PCRE_CONFIG_LINK_SIZE, &rc);
2177      printf("  Internal link size = %d\n", rc);      printf("  Internal link size = %d\n", rc);
2178      (void)pcre_config(PCRE_CONFIG_POSIX_MALLOC_THRESHOLD, &rc);      (void)PCRE_CONFIG(PCRE_CONFIG_POSIX_MALLOC_THRESHOLD, &rc);
2179      printf("  POSIX malloc threshold = %d\n", rc);      printf("  POSIX malloc threshold = %d\n", rc);
2180      (void)pcre_config(PCRE_CONFIG_MATCH_LIMIT, &lrc);      (void)PCRE_CONFIG(PCRE_CONFIG_MATCH_LIMIT, &lrc);
2181      printf("  Default match limit = %ld\n", lrc);      printf("  Default match limit = %ld\n", lrc);
2182      (void)pcre_config(PCRE_CONFIG_MATCH_LIMIT_RECURSION, &lrc);      (void)PCRE_CONFIG(PCRE_CONFIG_MATCH_LIMIT_RECURSION, &lrc);
2183      printf("  Default recursion depth limit = %ld\n", lrc);      printf("  Default recursion depth limit = %ld\n", lrc);
2184      (void)pcre_config(PCRE_CONFIG_STACKRECURSE, &rc);      (void)PCRE_CONFIG(PCRE_CONFIG_STACKRECURSE, &rc);
2185      printf("  Match recursion uses %s\n", rc? "stack" : "heap");      printf("  Match recursion uses %s\n", rc? "stack" : "heap");
2186      goto EXIT;      goto EXIT;
2187      }      }
# Line 2497  while (!done) Line 2539  while (!done)
2539          goto SKIP_DATA;          goto SKIP_DATA;
2540          }          }
2541        locale_set = 1;        locale_set = 1;
2542        tables = pcre_maketables();        tables = PCRE_MAKETABLES;
2543        pp = ppp;        pp = ppp;
2544        break;        break;
2545    
# Line 2719  while (!done) Line 2761  while (!done)
2761      if (do_debug)      if (do_debug)
2762        {        {
2763        fprintf(outfile, "------------------------------------------------------------------\n");        fprintf(outfile, "------------------------------------------------------------------\n");
2764  #if defined SUPPORT_PCRE8 && defined SUPPORT_PCRE16        PCRE_PRINTINT(re, outfile, debug_lengths);
       if (use_pcre16)  
         pcre16_printint(re, outfile, debug_lengths);  
       else  
         pcre_printint(re, outfile, debug_lengths);  
 #elif defined SUPPORT_PCRE8  
       pcre_printint(re, outfile, debug_lengths);  
 #else  
       pcre16_printint(re, outfile, debug_lengths);  
 #endif  
2765        }        }
2766    
2767      /* We already have the options in get_options (see above) */      /* We already have the options in get_options (see above) */
# Line 2736  while (!done) Line 2769  while (!done)
2769      if (do_showinfo)      if (do_showinfo)
2770        {        {
2771        unsigned long int all_options;        unsigned long int all_options;
 #if !defined NOINFOCHECK  
       int old_first_char, old_options, old_count;  
 #endif  
2772        int count, backrefmax, first_char, need_char, okpartial, jchanged,        int count, backrefmax, first_char, need_char, okpartial, jchanged,
2773          hascrorlf;          hascrorlf;
2774        int nameentrysize, namecount;        int nameentrysize, namecount;
# Line 2756  while (!done) Line 2786  while (!done)
2786        new_info(re, NULL, PCRE_INFO_JCHANGED, &jchanged);        new_info(re, NULL, PCRE_INFO_JCHANGED, &jchanged);
2787        new_info(re, NULL, PCRE_INFO_HASCRORLF, &hascrorlf);        new_info(re, NULL, PCRE_INFO_HASCRORLF, &hascrorlf);
2788    
       /* The old, obsolete function pcre_info() works only in 8-bit mode. Check  
       that it gives the same results as the new function. */  
   
 #if !defined NOINFOCHECK  
       if (!use_pcre16)  
         {  
         old_count = pcre_info(re, &old_options, &old_first_char);  
         if (count < 0) fprintf(outfile,  
           "Error %d from pcre_info()\n", count);  
         else  
           {  
           if (old_count != count) fprintf(outfile,  
             "Count disagreement: pcre_fullinfo=%d pcre_info=%d\n", count,  
               old_count);  
   
           if (old_first_char != first_char) fprintf(outfile,  
             "First char disagreement: pcre_fullinfo=%d pcre_info=%d\n",  
               first_char, old_first_char);  
   
           if (old_options != (int)get_options) fprintf(outfile,  
             "Options disagreement: pcre_fullinfo=%ld pcre_info=%d\n",  
               get_options, old_options);  
           }  
         }  
 #endif  
   
2789        if (size != regex_gotten_store) fprintf(outfile,        if (size != regex_gotten_store) fprintf(outfile,
2790          "Size disagreement: pcre_fullinfo=%d call to malloc for %d\n",          "Size disagreement: pcre_fullinfo=%d call to malloc for %d\n",
2791          (int)size, (int)regex_gotten_store);          (int)size, (int)regex_gotten_store);
# Line 3073  while (!done) Line 3077  while (!done)
3077      options = 0;      options = 0;
3078    
3079      *copynames = 0;      *copynames = 0;
3080        copynames[1] = 0;
3081      *getnames = 0;      *getnames = 0;
3082        getnames[1] = 0;
3083    
3084      copynamesptr = copynames;      copynamesptr = copynames;
3085      getnamesptr = getnames;      getnamesptr = getnames;
# Line 3370  while (!done) Line 3376  while (!done)
3376              && (extra->flags & PCRE_EXTRA_EXECUTABLE_JIT) != 0              && (extra->flags & PCRE_EXTRA_EXECUTABLE_JIT) != 0
3377              && extra->executable_jit != NULL)              && extra->executable_jit != NULL)
3378            {            {
3379            if (jit_stack != NULL) pcre_jit_stack_free(jit_stack);            if (jit_stack != NULL) PCRE_JIT_STACK_FREE(jit_stack);
3380            jit_stack = pcre_jit_stack_alloc(1, n * 1024);            jit_stack = PCRE_JIT_STACK_ALLOC(1, n * 1024);
3381            pcre_assign_jit_stack(extra, jit_callback, jit_stack);            PCRE_ASSIGN_JIT_STACK(extra, jit_callback, jit_stack);
3382            }            }
3383          continue;          continue;
3384    
# Line 3750  while (!done) Line 3756  while (!done)
3756            {            {
3757            if ((copystrings & (1 << i)) != 0)            if ((copystrings & (1 << i)) != 0)
3758              {              {
3759              int rc;              int rc;
3760              char copybuffer[256];              char copybuffer[256];
3761              PCRE_COPY_SUBSTRING(rc, bptr, use_offsets, count, i,              PCRE_COPY_SUBSTRING(rc, bptr, use_offsets, count, i,
3762                copybuffer, sizeof(copybuffer));                copybuffer, sizeof(copybuffer));
# Line 3766  while (!done) Line 3772  while (!done)
3772            }            }
3773    
3774          for (copynamesptr = copynames;          for (copynamesptr = copynames;
3775    
3776  #if defined SUPPORT_PCRE8 && defined SUPPORT_PCRE16  #if defined SUPPORT_PCRE8 && defined SUPPORT_PCRE16
3777               use_pcre16?               use_pcre16?
3778                 (*(PCRE_SCHAR16*)copynamesptr) != 0 : *copynamesptr != 0;                 (*(PCRE_SCHAR16*)copynamesptr) != 0 : *copynamesptr != 0;
# Line 3891  while (!done) Line 3898  while (!done)
3898        terminated by CRLF, an advance of one character just passes the \r,        terminated by CRLF, an advance of one character just passes the \r,
3899        whereas we should prefer the longer newline sequence, as does the code in        whereas we should prefer the longer newline sequence, as does the code in
3900        pcre_exec(). Fudge the offset value to achieve this. We check for a        pcre_exec(). Fudge the offset value to achieve this. We check for a
3901        newline setting in the pattern; if none was set, use pcre_config() to        newline setting in the pattern; if none was set, use PCRE_CONFIG() to
3902        find the default.        find the default.
3903    
3904        Otherwise, in the case of UTF-8 matching, the advance must be one        Otherwise, in the case of UTF-8 matching, the advance must be one
# Line 3907  while (!done) Line 3914  while (!done)
3914            if ((obits & PCRE_NEWLINE_BITS) == 0)            if ((obits & PCRE_NEWLINE_BITS) == 0)
3915              {              {
3916              int d;              int d;
3917              (void)pcre_config(PCRE_CONFIG_NEWLINE, &d);              (void)PCRE_CONFIG(PCRE_CONFIG_NEWLINE, &d);
3918              /* Note that these values are always the ASCII ones, even in              /* Note that these values are always the ASCII ones, even in
3919              EBCDIC environments. CR = 13, NL = 10. */              EBCDIC environments. CR = 13, NL = 10. */
3920              obits = (d == 13)? PCRE_NEWLINE_CR :              obits = (d == 13)? PCRE_NEWLINE_CR :
# Line 4022  while (!done) Line 4029  while (!done)
4029      }      }
4030    if (jit_stack != NULL)    if (jit_stack != NULL)
4031      {      {
4032      pcre_jit_stack_free(jit_stack);      PCRE_JIT_STACK_FREE(jit_stack);
4033      jit_stack = NULL;      jit_stack = NULL;
4034      }      }
4035    }    }

Legend:
Removed from v.817  
changed lines
  Added in v.818

  ViewVC Help
Powered by ViewVC 1.1.5