From 0946bf30c22ef959038e5c6b55c6a1fcf0d69bd3 Mon Sep 17 00:00:00 2001 From: Marc Horowitz Date: Fri, 26 Jul 1996 19:56:11 +0000 Subject: [PATCH] * an_to_ln.c (do_replacement, aname_do_match): use the compile() function in -lgen on solaris git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@8842 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/os/an_to_ln.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/src/lib/krb5/os/an_to_ln.c b/src/lib/krb5/os/an_to_ln.c index abf8d374c..ac1da6614 100644 --- a/src/lib/krb5/os/an_to_ln.c +++ b/src/lib/krb5/os/an_to_ln.c @@ -32,16 +32,10 @@ /* * Use compile(3) if no regcomp present. */ -#if !defined(HAVE_REGCOMP) && defined(HAVE_REGEXP_H) -#define INIT char *sp = instring; -#define GETC() (*sp++) -#define PEEKC() (*sp) -#define UNGETC(c) (--sp) -#define RETURN(c) return(c) -#define ERROR(c) +#if !defined(HAVE_REGCOMP) && defined(HAVE_REGEXPR_H) && defined(HAVE_COMPILE) #define RE_BUF_SIZE 1024 -#include -#endif /* !HAVE_REGCOMP && HAVE_REGEXP_H */ +#include +#endif /* !HAVE_REGCOMP && HAVE_REGEXP_H && HAVE_COMPILE */ #define MAX_FORMAT_BUFFER 1024 #ifndef min @@ -244,11 +238,10 @@ aname_do_match(string, contextp) kret = 0; } regfree(&match_exp); -#elif HAVE_REGEXP_H +#elif HAVE_REGEXPR_H compile(regexp, regexp_buffer, - ®exp_buffer[RE_BUF_SIZE], - '\0'); + ®exp_buffer[RE_BUF_SIZE]); if (step(string, regexp_buffer)) { if ((loc1 == string) && (loc2 == &string[strlen(string)])) @@ -319,7 +312,7 @@ do_replacement(regexp, repl, doall, in, out) } while (doall && matched); regfree(&match_exp); } -#elif HAVE_REGEXP_H +#elif HAVE_REGEXPR_H int matched; char *cp; char *op; @@ -328,8 +321,7 @@ do_replacement(regexp, repl, doall, in, out) compile(regexp, regexp_buffer, - ®exp_buffer[RE_BUF_SIZE], - '\0'); + ®exp_buffer[RE_BUF_SIZE]); cp = in; op = out; matched = 0; -- 2.26.2