~ubuntu-branches/ubuntu/trusty/pcre3/trusty

« back to all changes in this revision

Viewing changes to pcreposix.c

  • Committer: Package Import Robot
  • Author(s): Mark Baker
  • Date: 2012-03-23 22:34:54 UTC
  • mfrom: (23.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20120323223454-grhqqolk8a7x1h24
Tags: 1:8.30-4
* Reluctantly using an epoch, as it seems the funny version number with
  extra dots causes problems
* Bumped standard version to 3.9.3. No changes needed
* Converted to use new source format / quilt
* Put back obsolete pcre_info() API that upstream have dropped (Closes:
  #665300, #665356)
* Don't include pcregrep binary in debug package

Thanks to Elimar Riesebieter for the conversion to the new source format.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
and semantics are as close as possible to those of the Perl 5 language.
7
7
 
8
8
                       Written by Philip Hazel
9
 
           Copyright (c) 1997-2010 University of Cambridge
 
9
           Copyright (c) 1997-2012 University of Cambridge
10
10
 
11
11
-----------------------------------------------------------------------------
12
12
Redistribution and use in source and binary forms, with or without
152
152
  REG_BADPAT,  /* (*MARK) must have an argument */
153
153
  REG_INVARG,  /* this version of PCRE is not compiled with PCRE_UCP support */
154
154
  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 */
 
156
  /* 70 */
 
157
  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) */
155
162
};
156
163
 
157
164
/* Table of texts corresponding to POSIX error codes */
222
229
PCREPOSIX_EXP_DEFN void PCRE_CALL_CONVENTION
223
230
regfree(regex_t *preg)
224
231
{
225
 
(pcre_free)(preg->re_pcre);
 
232
(PUBL(free))(preg->re_pcre);
226
233
}
227
234
 
228
235
 
267
274
 
268
275
if (preg->re_pcre == NULL)
269
276
  {
270
 
  return (errorcode < sizeof(eint)/sizeof(const int))?
 
277
  return (errorcode < (int)(sizeof(eint)/sizeof(const int)))?
271
278
    eint[errorcode] : REG_BADPAT;
272
279
  }
273
280
 
274
 
preg->re_nsub = pcre_info((const pcre *)preg->re_pcre, NULL, NULL);
 
281
(void)pcre_fullinfo((const pcre *)preg->re_pcre, NULL, PCRE_INFO_CAPTURECOUNT,
 
282
  &(preg->re_nsub));
275
283
return 0;
276
284
}
277
285
 
397
405
  case PCRE_ERROR_MATCHLIMIT: return REG_ESPACE;
398
406
  case PCRE_ERROR_BADUTF8: return REG_INVARG;
399
407
  case PCRE_ERROR_BADUTF8_OFFSET: return REG_INVARG;
 
408
  case PCRE_ERROR_BADMODE: return REG_INVARG;
400
409
  default: return REG_ASSERT;
401
410
  }
402
411
}