diff -uNrb dotconf-1.0.2/ChangeLog dotconf-1.0.3/ChangeLog --- dotconf-1.0.2/ChangeLog Sat Mar 24 19:58:54 2001 +++ dotconf-1.0.3/ChangeLog Wed Jun 20 00:09:00 2001 @@ -1,3 +1,14 @@ +[2001 06 20] [v1.0.3] + Christian Keller of multilink.de sent in patches to correct these bugs: + - FIXED: usage of ContextChecker and/or ErrorHandler for Included files. + - FIXED: usage of Includepath without setting $DC_INCLUDEPATH + + - dotconf_cleanup failed to free() the memory allocated for + the include path [Mike Swieton spotted this] + + - License change for libpool: libpool is under LGPL now. + + [2001 03 23] [v1.0.2] Shane Wegner sent in patches to correct these errors: - fix an autoconf build issue diff -uNrb dotconf-1.0.2/configure dotconf-1.0.3/configure --- dotconf-1.0.2/configure Fri Mar 23 10:18:58 2001 +++ dotconf-1.0.3/configure Wed Jun 20 00:06:26 2001 @@ -545,9 +545,9 @@ # DOTCONF_MAJOR_VERSION=1 DOTCONF_MINOR_VERSION=0 -DOTCONF_MICRO_VERSION=2 -DOTCONF_INTERFACE_AGE=2 -DOTCONF_BINARY_AGE=2 +DOTCONF_MICRO_VERSION=3 +DOTCONF_INTERFACE_AGE=3 +DOTCONF_BINARY_AGE=3 DOTCONF_VERSION=$DOTCONF_MAJOR_VERSION.$DOTCONF_MINOR_VERSION.$DOTCONF_MICRO_VERSION @@ -737,7 +737,7 @@ PACKAGE=dotconf -VERSION=1.0.2 +VERSION=1.0.3 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } diff -uNrb dotconf-1.0.2/configure.in dotconf-1.0.3/configure.in --- dotconf-1.0.2/configure.in Fri Mar 23 10:18:44 2001 +++ dotconf-1.0.3/configure.in Wed Jun 20 00:05:56 2001 @@ -10,9 +10,9 @@ # DOTCONF_MAJOR_VERSION=1 DOTCONF_MINOR_VERSION=0 -DOTCONF_MICRO_VERSION=2 -DOTCONF_INTERFACE_AGE=2 -DOTCONF_BINARY_AGE=2 +DOTCONF_MICRO_VERSION=3 +DOTCONF_INTERFACE_AGE=3 +DOTCONF_BINARY_AGE=3 DOTCONF_VERSION=$DOTCONF_MAJOR_VERSION.$DOTCONF_MINOR_VERSION.$DOTCONF_MICRO_VERSION AC_SUBST(DOTCONF_MAJOR_VERSION) @@ -32,7 +32,7 @@ AC_SUBST(LT_REVISION) AC_SUBST(LT_AGE) -AM_INIT_AUTOMAKE(dotconf, 1.0.2) +AM_INIT_AUTOMAKE(dotconf, 1.0.3) AM_CONFIG_HEADER(config.h) AC_CANONICAL_HOST Binary files dotconf-1.0.2/examples/caseinsensitive/caseinsensitive and dotconf-1.0.3/examples/caseinsensitive/caseinsensitive differ Binary files dotconf-1.0.2/examples/caseinsensitive/caseinsensitive.o and dotconf-1.0.3/examples/caseinsensitive/caseinsensitive.o differ diff -uNrb dotconf-1.0.2/libpool/pool.c dotconf-1.0.3/libpool/pool.c --- dotconf-1.0.2/libpool/pool.c Wed Jan 24 01:25:15 2001 +++ dotconf-1.0.3/libpool/pool.c Tue Jun 19 23:38:01 2001 @@ -1,22 +1,24 @@ /* libpool - simple memory management library - * Copyright (C) 2000 Lukas Schroeder + * Copyright (C) 2000,2001 Lukas Schroeder * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#define LIBPOOL_VERSION "0.1.0 - 26 Sep 2000" +#define LIBPOOL_VERSION "0.1.1 - 20 Jun 2001" static const char libpool_version[] = LIBPOOL_VERSION; #include diff -uNrb dotconf-1.0.2/src/dotconf.c dotconf-1.0.3/src/dotconf.c --- dotconf-1.0.2/src/dotconf.c Wed Feb 21 16:51:49 2001 +++ dotconf-1.0.3/src/dotconf.c Wed Jun 20 00:12:13 2001 @@ -36,10 +36,11 @@ #include #ifndef WIN32 #include -#else +#else /* !WIN32 */ +#define strncasecmp strnicmp typedef unsigned long ulong; #define snprintf _snprintf - +#define vsnprintf _vsnprintf #define R_OK 0 int access(const char *pathname, int mode) { @@ -451,7 +452,7 @@ cp1++; /* ignore comments and empty lines */ - if (!cp1 || !*cp1 || *cp1 == '#' || *cp1 == '\n') + if (!cp1 || !*cp1 || *cp1 == '#' || *cp1 == '\n' || *cp1 == EOF) return NULL; /* skip line if it only contains whitespace */ @@ -624,14 +625,19 @@ new->flags = flags; new->filename = strdup(fname); + new->includepath = malloc(CFG_MAX_FILENAME); + new->includepath[0] = 0x00; + /* take includepath from environment if present */ if ((dc_env = getenv(CFG_INCLUDEPATH_ENV)) != NULL) - new->includepath = strdup(dc_env); + { + snprintf(new->includepath, CFG_MAX_FILENAME, "%s", dc_env); + } new->context = context; - dotconf_register_options(new, dotconf_options); /* internal options */ - dotconf_register_options(new, options); /* register main app options */ + dotconf_register_options(new, dotconf_options); + dotconf_register_options(new, options); if ( new->flags & CASE_INSENSITIVE ) new->cmp_func = strncasecmp; @@ -652,6 +658,9 @@ if (configfile->config_options) free(configfile->config_options); + if (configfile->includepath) + free(configfile->includepath); + free(configfile); } @@ -666,19 +675,26 @@ && cmd->data.str[0] != '/' && cmd->configfile->includepath[0] != '\0') { /* relative file AND include path is used */ - int len; + int len, inclen; char *sl; - /* check for length of fully qualified filename */ - if (( len = (strlen(cmd->data.str) + strlen(cmd->configfile->includepath) + 1)) == CFG_MAX_FILENAME) + inclen = strlen(cmd->configfile->includepath); + if (( len = (strlen(cmd->data.str) + inclen + 1)) == CFG_MAX_FILENAME) { dotconf_warning(cmd->configfile, DCLOG_WARNING, ERR_INCLUDE_ERROR, "Absolute filename too long (>%d)", CFG_MAX_FILENAME); return NULL; } + if (cmd->configfile->includepath[inclen - 1] == '/') + sl = ""; + else + { + sl = "/"; + len++; + } + filename = malloc(len); - sl = cmd->configfile->includepath[strlen(cmd->configfile->includepath) - 1]=='/'?"":"/"; snprintf(filename, len, "%s%s%s", cmd->configfile->includepath, sl, cmd->data.str); } @@ -698,6 +714,9 @@ cmd->configfile->context, cmd->configfile->flags); if (included) { + included->contextchecker = (dotconf_contextchecker_t) cmd->configfile->contextchecker; + included->errorhandler = (dotconf_errorhandler_t) cmd->configfile->errorhandler; + dotconf_command_loop(included); dotconf_cleanup(included); } @@ -708,8 +727,9 @@ DOTCONF_CB(dotconf_cb_includepath) { - char *env = getenv("DC_INCLUDEPATH"); - if (!env) /* environment overrides configuration file setting */ + char *env = getenv(CFG_INCLUDEPATH_ENV); + /* environment overrides configuration file setting */ + if (!env) snprintf(cmd->configfile->includepath, CFG_MAX_FILENAME, "%s", cmd->data.str); return NULL; }