From 40849fdb096d5d07a3ddc9f0136aad20b59d88d6 Mon Sep 17 00:00:00 2001 From: mouring Date: Sat, 17 Mar 2001 01:15:38 +0000 Subject: [PATCH] - Check for gl_matchc support in glob_t and fall back to the openbsd-compat/glob.[ch] support if it does not exist. --- ChangeLog | 2 ++ acconfig.h | 3 +++ configure.in | 18 ++++++++++++++++++ includes.h | 3 ++- openbsd-compat/glob.c | 6 ++++-- openbsd-compat/glob.h | 6 ++++-- 6 files changed, 33 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 377a6be8..dc7ae191 100644 --- a/ChangeLog +++ b/ChangeLog @@ -22,6 +22,8 @@ [auth-options.c channels.c channels.h serverloop.c session.c] implement "permitopen" key option, restricts -L style forwarding to to specified host:port pairs. based on work by harlan@genua.de + - Check for gl_matchc support in glob_t and fall back to the + openbsd-compat/glob.[ch] support if it does not exist. 20010315 - OpenBSD CVS Sync diff --git a/acconfig.h b/acconfig.h index d70e1b8f..75a63d45 100644 --- a/acconfig.h +++ b/acconfig.h @@ -305,6 +305,9 @@ /* Define if your system glob() function has the GLOB_ALTDIRFUNC extension */ #undef GLOB_HAS_ALTDIRFUNC +/* Define if your system glob() function has gl_matchc options in glob_t */ +#undef GLOB_HAS_GL_MATCHC + @BOTTOM@ /* ******************* Shouldn't need to edit below this line ************** */ diff --git a/configure.in b/configure.in index 45572d4a..df712bb0 100644 --- a/configure.in +++ b/configure.in @@ -388,6 +388,24 @@ AC_EGREP_CPP(FOUNDIT, ] ) +# Check for g.gl_matchc glob() extension +AC_MSG_CHECKING(for gl_matchc field in glob_t) +AC_EGREP_CPP(FOUNDIT, + [ + #include + int main(void){glob_t g; g.gl_matchc = 1;} + ], + [ + AC_DEFINE(GLOB_HAS_GL_MATCHC) + AC_MSG_RESULT(yes) + ], + [ + AC_MSG_RESULT(no) + ] +) + + + # Check whether user wants Kerberos support KRB4_MSG="no" AC_ARG_WITH(kerberos4, diff --git a/includes.h b/includes.h index 3f834ba8..8b7bb0ed 100644 --- a/includes.h +++ b/includes.h @@ -54,7 +54,8 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg } #ifdef HAVE_BSTRING_H # include #endif -#if defined(HAVE_GLOB_H) && defined(GLOB_HAS_ALTDIRFUNC) +#if defined(HAVE_GLOB_H) && defined(GLOB_HAS_ALTDIRFUNC) && \ + defined(GLOB_HAS_GL_MATCHC) # include #endif #ifdef HAVE_NETGROUP_H diff --git a/openbsd-compat/glob.c b/openbsd-compat/glob.c index 2e255186..e2fd7c27 100644 --- a/openbsd-compat/glob.c +++ b/openbsd-compat/glob.c @@ -37,7 +37,8 @@ #include "includes.h" #include -#if !defined(HAVE_GLOB) || !defined(GLOB_HAS_ALTDIRFUNC) +#if !defined(HAVE_GLOB) || !defined(GLOB_HAS_ALTDIRFUNC) || \ + !defined(GLOB_HAS_GL_MATCHC) #if defined(LIBC_SCCS) && !defined(lint) #if 0 @@ -855,5 +856,6 @@ qprintf(str, s) } #endif -#endif /* !defined(HAVE_GLOB) || !defined(GLOB_HAS_ALTDIRFUNC) */ +#endif /* !defined(HAVE_GLOB) || !defined(GLOB_HAS_ALTDIRFUNC) || + !defined(GLOB_HAS_GL_MATCHC) */ diff --git a/openbsd-compat/glob.h b/openbsd-compat/glob.h index 392c63b6..a08cee57 100644 --- a/openbsd-compat/glob.h +++ b/openbsd-compat/glob.h @@ -39,7 +39,8 @@ * @(#)glob.h 8.1 (Berkeley) 6/2/93 */ -#if !defined(HAVE_GLOB_H) || !defined(GLOB_HAS_ALTDIRFUNC) +#if !defined(HAVE_GLOB_H) || !defined(GLOB_HAS_ALTDIRFUNC) || \ + !defined(GLOB_HAS_GL_MATCHC) #ifndef _GLOB_H_ #define _GLOB_H_ @@ -94,5 +95,6 @@ void globfree __P((glob_t *)); #endif /* !_GLOB_H_ */ -#endif /* !defined(HAVE_GLOB_H) || !defined(GLOB_HAS_ALTDIRFUNC) */ +#endif /* !defined(HAVE_GLOB_H) || !defined(GLOB_HAS_ALTDIRFUNC) || + !defined(GLOB_HAS_GL_MATCHC */ -- 2.45.1