From 17416619185d3a9aeb006a931be0e50a25f809cf Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Mon, 29 Sep 1997 04:49:03 +0000 Subject: The new world order is to assume POSIX regexps. --- zwgc/regexp.c | 62 +---------------------------------------------------------- 1 file changed, 1 insertion(+), 61 deletions(-) (limited to 'zwgc/regexp.c') diff --git a/zwgc/regexp.c b/zwgc/regexp.c index f874e45..07fad58 100644 --- a/zwgc/regexp.c +++ b/zwgc/regexp.c @@ -13,20 +13,14 @@ */ #include +#include #if (!defined(lint) && !defined(SABER)) static const char rcsid_regexp_c[] = "$Id$"; #endif -#ifdef SOLARIS -#include -#endif - #include "regexp.h" -#ifdef HAVE_REGCOMP -#include - int ed_regexp_match_p(test_string, pattern) string test_string; string pattern; @@ -51,57 +45,3 @@ int ed_regexp_match_p(test_string, pattern) regfree(&RE); return(retval == 0 ? 1 : 0); } - -#else -char *re_comp(); -int re_exec(); - -int ed_regexp_match_p(test_string, pattern) - string test_string; - string pattern; -{ - char *comp_retval; - int exec_retval; - - if (comp_retval = re_comp(pattern)) { - fprintf(stderr,"%s in regex %s\n",comp_retval,pattern); - return(0); - } - if ((exec_retval=re_exec(test_string)) == -1) { - fprintf(stderr,"Internal error in re_exec()"); - return(0); - } - - return(exec_retval); -} -#endif - -#if !defined(HAVE_RE_COMP) && !defined(HAVE_REGCOMP) - -#ifdef HAVE_LIBGEN_H -#include -#endif - -static char *re; - -char *re_comp(s) - char *s; -{ - if(!s) - return 0; - if(re) - free(re); - - if(!(re = regcmp(s, (char *)0))) - return "Bad argument to re_comp"; - - return 0; -} - -int re_exec(s) - char *s; -{ - return regex(re, s) != 0; -} - -#endif -- cgit v1.2.3