regex: workaround MB_CUR_MAX in cygwin, plus a few cleanups.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@413 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2002-03-12 15:54:01 +00:00
parent de1a4700b6
commit ba03bd25be
4 changed files with 34 additions and 13 deletions

View File

@ -45,16 +45,16 @@ sobjs: $(SOBJS)
dll: regexp@SHLIB_SUFFIX@
regexp.o: $(srcdir)/regexp.c
regexp.o: $(srcdir)/regexp.c $(srcdir)/regex2.h $(srcdir)/engine.c
$(CC) -c $(CFLAGS) $(SHLIB_CFLAGS) $(srcdir)/regexp.c -o regexp.o
regcomp.o: $(srcdir)/regcomp.c
regcomp.o: $(srcdir)/regcomp.c $(srcdir)/regex2.h
$(CC) -c $(CFLAGS) $(SHLIB_CFLAGS) $(srcdir)/regcomp.c -o regcomp.o
regerror.o: $(srcdir)/regerror.c
$(CC) -c $(CFLAGS) $(SHLIB_CFLAGS) $(srcdir)/regerror.c -o regerror.o
regfree.o: $(srcdir)/regfree.c
regfree.o: $(srcdir)/regfree.c $(srcdir)/regex2.h
$(CC) -c $(CFLAGS) $(SHLIB_CFLAGS) $(srcdir)/regfree.c -o regfree.o
regexec.o: $(srcdir)/regexec.c

View File

@ -41,13 +41,25 @@
static char sccsid[] = "@(#)regcomp.c 8.5 (Berkeley) 3/20/94";
#endif /* LIBC_SCCS and not lint */
#include "config.h"
#include "c_interface.h"
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <limits.h>
#endif
#include <stdlib.h>
#include <stdio.h>
#if HAVE_STRING_H
#include <string.h>
#endif
#if HAVE_CTYPE_H && !defined(_WIN32) && !defined(__CYGWIN__)
#include <ctype.h>
#endif
#if HAVE_LIMITS_H
#include <limits.h>
#endif
#if HAVE_MALLOC_H
#include <malloc.h>
#endif
#include "yapregex.h"
#include "collate.h"
@ -911,7 +923,7 @@ register cset *cs;
switch (cp->fidx) {
case CALNUM:
for (c = CHAR_MIN; c <= CHAR_MAX; c++)
if (isalnum((uch)c))
if (isalpha((uch)c) || isdigit((uch)c))
CHadd(cs, c);
break;
case CALPHA:

View File

@ -170,4 +170,4 @@ struct re_guts {
/* misc utilities */
#define OUT (CHAR_MAX+1) /* a non-character value */
#define ISWORD(c) (isalnum((uch)(c)) || (c) == '_')
#define ISWORD(c) (isalpha((uch)(c)) || isdigit((uch)(c)) || (c) == '_')

View File

@ -48,15 +48,24 @@ static char sccsid[] = "@(#)regexec.c 8.3 (Berkeley) 3/20/94";
* macros that code uses. This lets the same code operate on two different
* representations for state sets.
*/
#include "config.h"
#include "c_interface.h"
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#if HAVE_CTYPE_H && !defined(_WIN32) && !defined(__CYGWIN__)
#include <ctype.h>
#include "c_interface.h"
#include "yapregex.h"
#endif
#if HAVE_STRING_H
#include <string.h>
#endif
#if HAVE_LIMITS_H
#include <limits.h>
#endif
#include "yapregex.h"
#include "utils.h"
#include "regex2.h"