void-packages/srcpkgs/nvi/patches/nvi-30-regex-character-clas...

27 lines
811 B
Diff

From: Wolfgang Jenkner <wjenkner@inode.at>
Date: Thu, 22 May 2008 16:33:57 +0200
Subject: [PATCH] p_b_cclass found the wrong cclass, due to a logical glitch.
E.g., it would find the cclass corresponding to [:alpha:] when searching
for the [:alnum:] one.
---
regex/regcomp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/regex/regcomp.c b/regex/regcomp.c
index b7509413..0b276aff 100644
--- a/regex/regcomp.c
+++ b/regex/regcomp.c
@@ -818,7 +818,7 @@ p_b_cclass(register struct parse *p, register cset *cs)
NEXT();
len = p->next - sp;
for (cp = cclasses; cp->name != NULL; cp++)
- if (STRLEN(cp->name) == len && MEMCMP(cp->name, sp, len))
+ if (STRLEN(cp->name) == len && !MEMCMP(cp->name, sp, len))
break;
if (cp->name == NULL) {
/* oops, didn't find it */
--
2.37.2