/[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 580 by ph10, Fri Nov 26 11:16:43 2010 UTC revision 598 by ph10, Sat May 7 15:37:31 2011 UTC
# Line 197  static uschar *buffer = NULL; Line 197  static uschar *buffer = NULL;
197  static uschar *dbuffer = NULL;  static uschar *dbuffer = NULL;
198  static uschar *pbuffer = NULL;  static uschar *pbuffer = NULL;
199    
200    /* Textual explanations for runtime error codes */
201    
202    static const char *errtexts[] = {
203      NULL,  /* 0 is no error */
204      NULL,  /* NOMATCH is handled specially */
205      "NULL argument passed",
206      "bad option value",
207      "magic number missing",
208      "unknown opcode - pattern overwritten?",
209      "no more memory",
210      NULL,  /* never returned by pcre_exec() or pcre_dfa_exec() */
211      "match limit exceeded",
212      "callout error code",
213      NULL,  /* BADUTF8 is handled specially */
214      "bad UTF-8 offset",
215      NULL,  /* PARTIAL is handled specially */
216      "not used - internal error",
217      "internal error - pattern overwritten?",
218      "bad count value",
219      "item unsupported for DFA matching",
220      "backreference condition or recursion test not supported for DFA matching",
221      "match limit not supported for DFA matching",
222      "workspace size exceeded in DFA matching",
223      "too much recursion for DFA matching",
224      "recursion limit exceeded",
225      "not used - internal error",
226      "invalid combination of newline options",
227      "bad offset value",
228      NULL  /* SHORTUTF8 is handled specially */
229    };
230    
231    
232  /*************************************************  /*************************************************
233  *         Alternate character tables             *  *         Alternate character tables             *
# Line 2858  while (!done) Line 2889  while (!done)
2889            }            }
2890          else          else
2891            {            {
2892            if (count == PCRE_ERROR_NOMATCH)            switch(count)
2893              {              {
2894                case PCRE_ERROR_NOMATCH:
2895              if (gmatched == 0)              if (gmatched == 0)
2896                {                {
2897                if (markptr == NULL) fprintf(outfile, "No match\n");                if (markptr == NULL) fprintf(outfile, "No match\n");
2898                  else fprintf(outfile, "No match, mark = %s\n", markptr);                  else fprintf(outfile, "No match, mark = %s\n", markptr);
2899                }                }
2900                break;
2901    
2902                case PCRE_ERROR_BADUTF8:
2903                case PCRE_ERROR_SHORTUTF8:
2904                fprintf(outfile, "Error %d (%s UTF-8 string)", count,
2905                  (count == PCRE_ERROR_BADUTF8)? "bad" : "short");
2906                if (use_size_offsets >= 2)
2907                  fprintf(outfile, " offset=%d reason=%d", use_offsets[0],
2908                    use_offsets[1]);
2909                fprintf(outfile, "\n");
2910                break;
2911    
2912                default:
2913                fprintf(outfile, "Error %d (%s)\n", count, errtexts[-count]);
2914                break;
2915              }              }
2916            else fprintf(outfile, "Error %d\n", count);  
2917            break;  /* Out of the /g loop */            break;  /* Out of the /g loop */
2918            }            }
2919          }          }

Legend:
Removed from v.580  
changed lines
  Added in v.598

  ViewVC Help
Powered by ViewVC 1.1.5