summaryrefslogtreecommitdiffstats
path: root/lib/libc/regex/regcomp.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>1997-04-28 20:44:55 +0000
committermillert <millert@openbsd.org>1997-04-28 20:44:55 +0000
commit442a6afd2aa35676c3e5e1eb30f8d6b41db981ab (patch)
treeea2d2cb3c05319abe61a7d935cd240301677dbdf /lib/libc/regex/regcomp.c
parentDeal with $TERM not being set (like in single user mode). (diff)
downloadwireguard-openbsd-442a6afd2aa35676c3e5e1eb30f8d6b41db981ab.tar.xz
wireguard-openbsd-442a6afd2aa35676c3e5e1eb30f8d6b41db981ab.zip
- cast usages of *printf() to void since we don't check return val
- move an assert to be *before* a strcpy() where it can do some good. - integrate NetBSD fixes for 64-bit machines (NetBSD PR #3450, Ross Harvey) - add lite2 tags
Diffstat (limited to 'lib/libc/regex/regcomp.c')
-rw-r--r--lib/libc/regex/regcomp.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/lib/libc/regex/regcomp.c b/lib/libc/regex/regcomp.c
index 283f66c40db..e1aad4f4b57 100644
--- a/lib/libc/regex/regcomp.c
+++ b/lib/libc/regex/regcomp.c
@@ -33,10 +33,16 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
+ *
+ * @(#)regcomp.c 8.5 (Berkeley) 3/20/94
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: regcomp.c,v 1.3 1996/09/15 09:31:25 tholo Exp $";
+#if 0
+static char sccsid[] = "@(#)regcomp.c 8.5 (Berkeley) 3/20/94";
+#else
+static char rcsid[] = "$OpenBSD: regcomp.c,v 1.4 1997/04/28 20:44:59 millert Exp $";
+#endif
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -101,6 +107,7 @@ static int freezeset __P((struct parse *p, cset *cs));
static int firstch __P((struct parse *p, cset *cs));
static int nch __P((struct parse *p, cset *cs));
static void mcadd __P((struct parse *p, cset *cs, char *cp));
+static char *mcfind __P((cset *cs, char *cp));
static void mcinvert __P((struct parse *p, cset *cs));
static void mccase __P((struct parse *p, cset *cs));
static int isinsets __P((struct re_guts *g, int c));
@@ -1258,6 +1265,25 @@ register char *cp;
}
/*
+ - mcfind - find a collating element in a cset
+ == static char *mcfind(register cset *cs, register char *cp);
+ */
+static char *
+mcfind(cs, cp)
+register cset *cs;
+register char *cp;
+{
+ register char *p;
+
+ if (cs->multis == NULL)
+ return(NULL);
+ for (p = cs->multis; *p != '\0'; p += strlen(p) + 1)
+ if (strcmp(cp, p) == 0)
+ return(p);
+ return(NULL);
+}
+
+/*
- mcinvert - invert the list of collating elements in a cset
== static void mcinvert(register struct parse *p, register cset *cs);
*