From: amosjeffries <> Date: Tue, 26 Feb 2008 06:43:03 +0000 (+0000) Subject: Author: serassio X-Git-Tag: SQUID_3_0_STABLE2~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c0d4025b6133efad8580ac2acf4b6149c45ea7a;p=thirdparty%2Fsquid.git Author: serassio Add check for glob() and glob.h availability glob() and glob.h are not available on all platforms. --- diff --git a/configure b/configure index 008d82e068..447d5ec59d 100755 --- a/configure +++ b/configure @@ -24249,6 +24249,7 @@ for ac_header in \ fcntl.h \ fnmatch.h \ getopt.h \ + glob.h \ gnumalloc.h \ grp.h \ ip_compat.h \ @@ -42521,6 +42522,7 @@ for ac_func in \ getrusage \ getspnam \ gettimeofday \ + glob \ htobe16 \ htole16 \ kqueue\ diff --git a/configure.in b/configure.in index 751496d6ec..72043145df 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ dnl Configuration input file for Squid dnl -dnl $Id: configure.in,v 1.488.2.1 2007/12/13 22:01:30 wessels Exp $ +dnl $Id: configure.in,v 1.488.2.2 2008/02/25 23:43:04 amosjeffries Exp $ dnl dnl dnl @@ -11,7 +11,7 @@ AM_CONFIG_HEADER(include/autoconf.h) AC_CONFIG_AUX_DIR(cfgaux) AC_CONFIG_SRCDIR([src/main.cc]) AM_INIT_AUTOMAKE([tar-ustar]) -AC_REVISION($Revision: 1.488.2.1 $)dnl +AC_REVISION($Revision: 1.488.2.2 $)dnl AC_PREFIX_DEFAULT(/usr/local/squid) AM_MAINTAINER_MODE @@ -1848,6 +1848,7 @@ AC_CHECK_HEADERS( \ fcntl.h \ fnmatch.h \ getopt.h \ + glob.h \ gnumalloc.h \ grp.h \ ip_compat.h \ @@ -2493,6 +2494,7 @@ AC_CHECK_FUNCS(\ getrusage \ getspnam \ gettimeofday \ + glob \ htobe16 \ htole16 \ kqueue\ diff --git a/include/autoconf.h.in b/include/autoconf.h.in index 5a54db1b5e..0dd1013063 100644 --- a/include/autoconf.h.in +++ b/include/autoconf.h.in @@ -170,6 +170,12 @@ /* Define to 1 if you have the header file. */ #undef HAVE_GLIB_H +/* Define to 1 if you have the `glob' function. */ +#undef HAVE_GLOB + +/* Define to 1 if you have the header file. */ +#undef HAVE_GLOB_H + /* Define to 1 if you have the header file. */ #undef HAVE_GNUMALLOC_H diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 16edc1750f..15b917cb5c 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.cc,v 1.528.2.5 2008/02/25 23:41:50 amosjeffries Exp $ + * $Id: cache_cf.cc,v 1.528.2.6 2008/02/25 23:43:05 amosjeffries Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -46,7 +46,9 @@ #include "Parsing.h" #include "MemBuf.h" #include "wordlist.h" +#if HAVE_GLOB_H #include +#endif #if SQUID_SNMP #include "snmp.h" @@ -211,6 +213,7 @@ parseManyConfigFiles(char* files, int depth) { int error_count = 0; char* saveptr = NULL; +#if HAVE_GLOB char *path; glob_t globbuf; int i; @@ -225,6 +228,13 @@ parseManyConfigFiles(char* files, int depth) error_count += parseOneConfigFile(globbuf.gl_pathv[i], depth); } globfree(&globbuf); +#else + char* file = strwordtok(files, &saveptr); + while (file != NULL) { + error_count += parseOneConfigFile(file, depth); + file = strwordtok(NULL, &saveptr); + } +#endif /* HAVE_GLOB */ return error_count; }