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

Diff of /code/trunk/pcreposix.c

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

revision 835 by ph10, Wed Dec 28 16:10:09 2011 UTC revision 975 by ph10, Sat Jun 2 11:03:06 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 154  static const int eint[] = { Line 154  static const int eint[] = {
154    REG_BADPAT,  /* \c must be followed by an ASCII character */    REG_BADPAT,  /* \c must be followed by an ASCII character */
155    REG_BADPAT,  /* \k is not followed by a braced, angle-bracketed, or quoted name */    REG_BADPAT,  /* \k is not followed by a braced, angle-bracketed, or quoted name */
156    /* 70 */    /* 70 */
157    REG_BADPAT,  /* internal error: unknown opcode in find_fixedlength() */    REG_BADPAT,  /* internal error: unknown opcode in find_fixedlength() */
158      REG_BADPAT,  /* \N is not supported in a class */
159      REG_BADPAT,  /* too many forward references */
160      REG_BADPAT,  /* disallowed UTF-8/16 code point (>= 0xd800 && <= 0xdfff) */
161      REG_BADPAT,  /* invalid UTF-16 string (should not occur) */
162      /* 75 */
163      REG_BADPAT   /* overlong MARK name */
164  };  };
165    
166  /* Table of texts corresponding to POSIX error codes */  /* Table of texts corresponding to POSIX error codes */
# Line 225  return length + addlength; Line 231  return length + addlength;
231  PCREPOSIX_EXP_DEFN void PCRE_CALL_CONVENTION  PCREPOSIX_EXP_DEFN void PCRE_CALL_CONVENTION
232  regfree(regex_t *preg)  regfree(regex_t *preg)
233  {  {
234  (pcre_free)(preg->re_pcre);  (PUBL(free))(preg->re_pcre);
235  }  }
236    
237    
# Line 270  should not happen, but we all make mista Line 276  should not happen, but we all make mista
276    
277  if (preg->re_pcre == NULL)  if (preg->re_pcre == NULL)
278    {    {
279    return (errorcode < sizeof(eint)/sizeof(const int))?    return (errorcode < (int)(sizeof(eint)/sizeof(const int)))?
280      eint[errorcode] : REG_BADPAT;      eint[errorcode] : REG_BADPAT;
281    }    }
282    
283  preg->re_nsub = pcre_info((const pcre *)preg->re_pcre, NULL, NULL);  (void)pcre_fullinfo((const pcre *)preg->re_pcre, NULL, PCRE_INFO_CAPTURECOUNT,
284      &(preg->re_nsub));
285  return 0;  return 0;
286  }  }
287    
# Line 400  switch(rc) Line 407  switch(rc)
407    case PCRE_ERROR_MATCHLIMIT: return REG_ESPACE;    case PCRE_ERROR_MATCHLIMIT: return REG_ESPACE;
408    case PCRE_ERROR_BADUTF8: return REG_INVARG;    case PCRE_ERROR_BADUTF8: return REG_INVARG;
409    case PCRE_ERROR_BADUTF8_OFFSET: return REG_INVARG;    case PCRE_ERROR_BADUTF8_OFFSET: return REG_INVARG;
410      case PCRE_ERROR_BADMODE: return REG_INVARG;
411    default: return REG_ASSERT;    default: return REG_ASSERT;
412    }    }
413  }  }

Legend:
Removed from v.835  
changed lines
  Added in v.975

  ViewVC Help
Powered by ViewVC 1.1.5