/[pcre]/code/tags/pcre-2.00/pcreposix.c
ViewVC logotype

Diff of /code/tags/pcre-2.00/pcreposix.c

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

revision 7 by nigel, Sat Feb 24 21:38:09 2007 UTC revision 23 by nigel, Sat Feb 24 21:38:41 2007 UTC
# Line 12  functions. Line 12  functions.
12    
13  Written by: Philip Hazel <ph10@cam.ac.uk>  Written by: Philip Hazel <ph10@cam.ac.uk>
14    
15             Copyright (c) 1997 University of Cambridge             Copyright (c) 1998 University of Cambridge
16    
17  -----------------------------------------------------------------------------  -----------------------------------------------------------------------------
18  Permission is granted to anyone to use this software for any purpose on any  Permission is granted to anyone to use this software for any purpose on any
# Line 42  restrictions: Line 42  restrictions:
42  static const char *estring[] = {  static const char *estring[] = {
43    ERR1,  ERR2,  ERR3,  ERR4,  ERR5,  ERR6,  ERR7,  ERR8,  ERR9,  ERR10,    ERR1,  ERR2,  ERR3,  ERR4,  ERR5,  ERR6,  ERR7,  ERR8,  ERR9,  ERR10,
44    ERR11, ERR12, ERR13, ERR14, ERR15, ERR16, ERR17, ERR18, ERR19, ERR20,    ERR11, ERR12, ERR13, ERR14, ERR15, ERR16, ERR17, ERR18, ERR19, ERR20,
45    ERR21, ERR22, ERR23 };    ERR21, ERR22, ERR23, ERR24, ERR25 };
46    
47  static int eint[] = {  static int eint[] = {
48    REG_EESCAPE, /* "\\ at end of pattern" */    REG_EESCAPE, /* "\\ at end of pattern" */
# Line 67  static int eint[] = { Line 67  static int eint[] = {
67    REG_ESIZE,   /* "regular expression too large" */    REG_ESIZE,   /* "regular expression too large" */
68    REG_ESPACE,  /* "failed to get memory" */    REG_ESPACE,  /* "failed to get memory" */
69    REG_EPAREN,  /* "unmatched brackets" */    REG_EPAREN,  /* "unmatched brackets" */
70    REG_ASSERT   /* "internal error: code overflow" */    REG_ASSERT,  /* "internal error: code overflow" */
71      REG_BADPAT,  /* "unrecognized character after (?<" */
72      REG_BADPAT,  /* "lookbehind assertion is not fixed length" */
73      REG_BADPAT,  /* "malformed number after (?(" */
74      REG_BADPAT,  /* "conditional group containe more than two branches" */
75      REG_BADPAT   /* "assertion expected after (?(" */
76  };  };
77    
78  /* Table of texts corresponding to POSIX error codes */  /* Table of texts corresponding to POSIX error codes */
# Line 135  addlength = (preg != NULL && (int)preg-> Line 140  addlength = (preg != NULL && (int)preg->
140  if (errbuf_size > 0)  if (errbuf_size > 0)
141    {    {
142    if (addlength > 0 && errbuf_size >= length + addlength)    if (addlength > 0 && errbuf_size >= length + addlength)
143      sprintf(errbuf, "%s%s%-6d", message, addmessage, preg->re_erroffset);      sprintf(errbuf, "%s%s%-6d", message, addmessage, (int)preg->re_erroffset);
144    else    else
145      {      {
146      strncpy(errbuf, message, errbuf_size - 1);      strncpy(errbuf, message, errbuf_size - 1);
# Line 212  int options = 0; Line 217  int options = 0;
217  if ((eflags & REG_NOTBOL) != 0) options |= PCRE_NOTBOL;  if ((eflags & REG_NOTBOL) != 0) options |= PCRE_NOTBOL;
218  if ((eflags & REG_NOTEOL) != 0) options |= PCRE_NOTEOL;  if ((eflags & REG_NOTEOL) != 0) options |= PCRE_NOTEOL;
219    
220  preg->re_erroffset = -1;   /* Only has meaning after compile */  preg->re_erroffset = (size_t)(-1);   /* Only has meaning after compile */
221    
222  rc = pcre_exec(preg->re_pcre, NULL, string, (int)strlen(string), options,  rc = pcre_exec(preg->re_pcre, NULL, string, (int)strlen(string), options,
223    (int *)pmatch, nmatch * 2);    (int *)pmatch, nmatch * 2);
# Line 229  if (rc > 0) Line 234  if (rc > 0)
234  else switch(rc)  else switch(rc)
235    {    {
236    case PCRE_ERROR_NOMATCH: return REG_NOMATCH;    case PCRE_ERROR_NOMATCH: return REG_NOMATCH;
   case PCRE_ERROR_BADREF: return REG_ESUBREG;  
237    case PCRE_ERROR_NULL: return REG_INVARG;    case PCRE_ERROR_NULL: return REG_INVARG;
238    case PCRE_ERROR_BADOPTION: return REG_INVARG;    case PCRE_ERROR_BADOPTION: return REG_INVARG;
239    case PCRE_ERROR_BADMAGIC: return REG_INVARG;    case PCRE_ERROR_BADMAGIC: return REG_INVARG;

Legend:
Removed from v.7  
changed lines
  Added in v.23

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12