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

Diff of /code/trunk/pcre_printint.c

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

code/branches/pcre16/pcre_printint.c revision 810 by ph10, Mon Dec 19 13:34:10 2011 UTC code/trunk/pcre_printint.c revision 852 by zherczeg, Thu Jan 5 19:18:12 2012 UTC
# Line 6  Line 6 
6  and semantics are as close as possible to those of the Perl 5 language.  and semantics are as close as possible to those of the Perl 5 language.
7    
8                         Written by Philip Hazel                         Written by Philip Hazel
9             Copyright (c) 1997-2010 University of Cambridge             Copyright (c) 1997-2012 University of Cambridge
10    
11  -----------------------------------------------------------------------------  -----------------------------------------------------------------------------
12  Redistribution and use in source and binary forms, with or without  Redistribution and use in source and binary forms, with or without
# Line 114  print_char(FILE *f, pcre_uchar *ptr, BOO Line 114  print_char(FILE *f, pcre_uchar *ptr, BOO
114  int c = *ptr;  int c = *ptr;
115    
116  #ifndef SUPPORT_UTF  #ifndef SUPPORT_UTF
117    
118  (void)utf;  /* Avoid compiler warning */  (void)utf;  /* Avoid compiler warning */
119  if (PRINTABLE(c)) fprintf(f, "%c", c); else fprintf(f, "\\x%02x", c);  if (PRINTABLE(c)) fprintf(f, "%c", c);
120    else if (c <= 0xff) fprintf(f, "\\x%02x", c);
121    else fprintf(f, "\\x{%x}", c);
122  return 0;  return 0;
123    
124  #else  #else
# Line 247  void Line 250  void
250  pcre16_printint(pcre *external_re, FILE *f, BOOL print_lengths)  pcre16_printint(pcre *external_re, FILE *f, BOOL print_lengths)
251  #endif  #endif
252  {  {
253  real_pcre *re = (real_pcre *)external_re;  REAL_PCRE *re = (REAL_PCRE *)external_re;
254  pcre_uchar *codestart, *code;  pcre_uchar *codestart, *code;
255  BOOL utf;  BOOL utf;
256    
# Line 475  for(;;) Line 478  for(;;)
478      if (PRINTABLE(c)) fprintf(f, " %s [^%c]", flag, c);      if (PRINTABLE(c)) fprintf(f, " %s [^%c]", flag, c);
479      else if (utf || c > 0xff)      else if (utf || c > 0xff)
480        fprintf(f, " %s [^\\x{%02x}]", flag, c);        fprintf(f, " %s [^\\x{%02x}]", flag, c);
481      else      else
482        fprintf(f, " %s [^\\x%02x]", flag, c);        fprintf(f, " %s [^\\x%02x]", flag, c);
483      break;      break;
484    
# Line 627  for(;;) Line 630  for(;;)
630              }              }
631            else            else
632              {              {
633              ccode += 1 + print_char(f, ccode, TRUE);              ccode += 1 + print_char(f, ccode, utf);
634              if (ch == XCL_RANGE)              if (ch == XCL_RANGE)
635                {                {
636                fprintf(f, "-");                fprintf(f, "-");
637                ccode += 1 + print_char(f, ccode, TRUE);                ccode += 1 + print_char(f, ccode, utf);
638                }                }
639              }              }
640            }            }

Legend:
Removed from v.810  
changed lines
  Added in v.852

  ViewVC Help
Powered by ViewVC 1.1.5