summaryrefslogtreecommitdiffstats
path: root/Modules/regexpr.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-12-02 20:39:23 (GMT)
committerGuido van Rossum <guido@python.org>1997-12-02 20:39:23 (GMT)
commite59d3f8ae1bd7748b2bcdf42a8bbb21fcc2d698a (patch)
treeb9ecf227673286781af57c714ffa15e442a42f5d /Modules/regexpr.c
parentf259a8e5c339f73fff8c1f2383079e967120efbd (diff)
downloadcpython-e59d3f8ae1bd7748b2bcdf42a8bbb21fcc2d698a.zip
cpython-e59d3f8ae1bd7748b2bcdf42a8bbb21fcc2d698a.tar.gz
cpython-e59d3f8ae1bd7748b2bcdf42a8bbb21fcc2d698a.tar.bz2
Small bugfixes for broken old style use of the syntax table. AMK, of
course.
Diffstat (limited to 'Modules/regexpr.c')
-rw-r--r--Modules/regexpr.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Modules/regexpr.c b/Modules/regexpr.c
index 7cdcbd9..64e199d 100644
--- a/Modules/regexpr.c
+++ b/Modules/regexpr.c
@@ -611,7 +611,7 @@ static void re_compile_fastmap_aux(code,
{
syntaxcode = code[pos++];
for (a = 0; a < 256; a++)
- if (SYNTAX(a) == syntaxcode)
+ if (SYNTAX(a) & syntaxcode)
fastmap[a] = 1;
return;
}
@@ -619,7 +619,7 @@ static void re_compile_fastmap_aux(code,
{
syntaxcode = code[pos++];
for (a = 0; a < 256; a++)
- if (SYNTAX(a) != syntaxcode)
+ if (!(SYNTAX(a) & syntaxcode) )
fastmap[a] = 1;
return;
}
@@ -1866,12 +1866,12 @@ int re_match(bufp,
if (translate)
{
while (text < textend &&
- translate[SYNTAX(*text)] == a)
+ (SYNTAX(translate[*text]) & a) )
text++;
}
else
{
- while (text < textend && SYNTAX(*text) == a)
+ while (text < textend && (SYNTAX(*text) & a) )
text++;
}
break;
@@ -1882,12 +1882,12 @@ int re_match(bufp,
if (translate)
{
while (text < textend &&
- translate[SYNTAX(*text)] != a)
+ !(SYNTAX(translate[*text]) & a) )
text++;
}
else
{
- while (text < textend && SYNTAX(*text) != a)
+ while (text < textend && !(SYNTAX(*text) & a) )
text++;
}
break;