Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/regex if we don't have any sets yet, don't try to l...
details: https://anonhg.NetBSD.org/src/rev/b0097aa83f8c
branches: trunk
changeset: 771091:b0097aa83f8c
user: christos <christos%NetBSD.org@localhost>
date: Tue Nov 08 19:25:45 2011 +0000
description:
if we don't have any sets yet, don't try to look in them.
diffstat:
lib/libc/regex/regcomp.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diffs (36 lines):
diff -r 688fd8b1352b -r b0097aa83f8c lib/libc/regex/regcomp.c
--- a/lib/libc/regex/regcomp.c Tue Nov 08 19:11:19 2011 +0000
+++ b/lib/libc/regex/regcomp.c Tue Nov 08 19:25:45 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: regcomp.c,v 1.31 2011/10/09 22:14:17 christos Exp $ */
+/* $NetBSD: regcomp.c,v 1.32 2011/11/08 19:25:45 christos Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -76,7 +76,7 @@
#if 0
static char sccsid[] = "@(#)regcomp.c 8.5 (Berkeley) 3/20/94";
#else
-__RCSID("$NetBSD: regcomp.c,v 1.31 2011/10/09 22:14:17 christos Exp $");
+__RCSID("$NetBSD: regcomp.c,v 1.32 2011/11/08 19:25:45 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -761,7 +761,6 @@
{
cset *cs;
int invert = 0;
-
_DIAGASSERT(p != NULL);
cs = allocset(p);
@@ -1562,6 +1561,9 @@
_DIAGASSERT(g != NULL);
+ if (g->setbits == NULL)
+ return 0;
+
ncols = (g->ncsets+(CHAR_BIT-1)) / CHAR_BIT;
for (i = 0, col = g->setbits; i < ncols; i++, col += g->csetsize)
Home |
Main Index |
Thread Index |
Old Index