"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pcreposix.c" between
pcre-8.43.tar.bz2 and pcre-8.44.tar.bz2

About: The PCRE library implements Perl compatible regular expression pattern matching.

pcreposix.c  (pcre-8.43.tar.bz2):pcreposix.c  (pcre-8.44.tar.bz2)
/************************************************* /*************************************************
* Perl-Compatible Regular Expressions * * Perl-Compatible Regular Expressions *
*************************************************/ *************************************************/
/* PCRE is a library of functions to support regular expressions whose syntax /* PCRE is a library of functions to support regular expressions whose syntax
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.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2018 University of Cambridge Copyright (c) 1997-2020 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met: modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, * Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer. this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright * Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the notice, this list of conditions and the following disclaimer in the
skipping to change at line 288 skipping to change at line 288
if (preg->re_pcre == NULL) if (preg->re_pcre == NULL)
{ {
return (errorcode < (int)(sizeof(eint)/sizeof(const int)))? return (errorcode < (int)(sizeof(eint)/sizeof(const int)))?
eint[errorcode] : REG_BADPAT; eint[errorcode] : REG_BADPAT;
} }
(void)pcre_fullinfo((const pcre *)preg->re_pcre, NULL, PCRE_INFO_CAPTURECOUNT, (void)pcre_fullinfo((const pcre *)preg->re_pcre, NULL, PCRE_INFO_CAPTURECOUNT,
&re_nsub); &re_nsub);
preg->re_nsub = (size_t)re_nsub; preg->re_nsub = (size_t)re_nsub;
preg->re_erroffset = (size_t)(-1); /* No meaning after successful compile */
return 0; return 0;
} }
/************************************************* /*************************************************
* Match a regular expression * * Match a regular expression *
*************************************************/ *************************************************/
/* Unfortunately, PCRE requires 3 ints of working space for each captured /* Unfortunately, PCRE requires 3 ints of working space for each captured
substring, so we have to get and release working store instead of just using substring, so we have to get and release working store instead of just using
the POSIX structures as was done in earlier releases when PCRE needed only 2 the POSIX structures as was done in earlier releases when PCRE needed only 2
skipping to change at line 322 skipping to change at line 323
int *ovector = NULL; int *ovector = NULL;
int small_ovector[POSIX_MALLOC_THRESHOLD * 3]; int small_ovector[POSIX_MALLOC_THRESHOLD * 3];
BOOL allocated_ovector = FALSE; BOOL allocated_ovector = FALSE;
BOOL nosub = BOOL nosub =
(REAL_PCRE_OPTIONS((const pcre *)preg->re_pcre) & PCRE_NO_AUTO_CAPTURE) != 0; (REAL_PCRE_OPTIONS((const pcre *)preg->re_pcre) & PCRE_NO_AUTO_CAPTURE) != 0;
if ((eflags & REG_NOTBOL) != 0) options |= PCRE_NOTBOL; if ((eflags & REG_NOTBOL) != 0) options |= PCRE_NOTBOL;
if ((eflags & REG_NOTEOL) != 0) options |= PCRE_NOTEOL; if ((eflags & REG_NOTEOL) != 0) options |= PCRE_NOTEOL;
if ((eflags & REG_NOTEMPTY) != 0) options |= PCRE_NOTEMPTY; if ((eflags & REG_NOTEMPTY) != 0) options |= PCRE_NOTEMPTY;
((regex_t *)preg)->re_erroffset = (size_t)(-1); /* Only has meaning after compi
le */
/* When no string data is being returned, or no vector has been passed in which /* When no string data is being returned, or no vector has been passed in which
to put it, ensure that nmatch is zero. Otherwise, ensure the vector for holding to put it, ensure that nmatch is zero. Otherwise, ensure the vector for holding
the return data is large enough. */ the return data is large enough. */
if (nosub || pmatch == NULL) nmatch = 0; if (nosub || pmatch == NULL) nmatch = 0;
else if (nmatch > 0) else if (nmatch > 0)
{ {
if (nmatch <= POSIX_MALLOC_THRESHOLD) if (nmatch <= POSIX_MALLOC_THRESHOLD)
{ {
 End of changes. 3 change blocks. 
4 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)