Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 557dea1

Browse files
committed
AMK's latest -- synchronized with PCRE 1.04.
1 parent 0148bbf commit 557dea1

4 files changed

Lines changed: 179 additions & 125 deletions

File tree

Modules/pcre-int.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*************************************************/
44

55

6-
#define PCRE_VERSION "1.02 12-Dec-1997"
6+
#define PCRE_VERSION "1.04 22-Dec-1997"
77

88

99
/* This is a library of functions to support regular expressions whose syntax
@@ -39,6 +39,7 @@ modules, but which are not relevant to the outside. */
3939
define a macro for memmove() if USE_BCOPY is defined. */
4040

4141
#ifdef USE_BCOPY
42+
#undef memmove /* some systems may have a macro */
4243
#define memmove(a, b, c) bcopy(b, a, c)
4344
#endif
4445

@@ -53,6 +54,13 @@ define a macro for memmove() if USE_BCOPY is defined. */
5354
#include <string.h>
5455
#include "pcre.h"
5556

57+
/* In case there is no definition of offsetof() provided - though any proper
58+
Standard C system should have one. */
59+
60+
#ifndef offsetof
61+
#define offsetof(p_type,field) ((size_t)&(((p_type *)0)->field))
62+
#endif
63+
5664
/* Private options flags start at the most significant end of the two bytes.
5765
The public options defined in pcre.h start at the least significant end. Make
5866
sure they don't overlap! */

Modules/pcre.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
/* Have to include stdlib.h in order to ensure that size_t is defined;
1515
it is needed here for malloc. */
1616

17+
#include <sys/types.h>
1718
#include <stdlib.h>
1819

1920
/* Options */

Modules/pcremodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ PyPcre_compile(self, args)
231231
newpattern[j++]='\0';
232232
newpattern[j++]='\0';
233233
newpattern[j++]='\0';
234-
newpattern[j]='\0';
234+
newpattern[j]='\0';
235235

236236
rv->regex = pcre_compile((char*)newpattern, options,
237237
&error, &erroroffset, dictionary);

0 commit comments

Comments
 (0)