--- config.c.orig 2005-10-31 15:44:09.000000000 -0500 +++ config.c 2005-10-31 15:50:55.000000000 -0500 @@ -30,6 +30,7 @@ #include #include #include +#include #define AST_INCLUDE_GLOB 1 #ifdef AST_INCLUDE_GLOB #ifdef __Darwin__ @@ -573,7 +574,14 @@ ast_verbose( VERBOSE_PREFIX_2 "Parsing '%s': ", fn); fflush(stdout); } - if ((f = fopen(fn, "r"))) { + struct stat sbuf; + stat(fn,&sbuf); + if (S_ISDIR(sbuf.st_mode)) { /* it's a directory */ + if (option_debug) + ast_log(LOG_DEBUG, "Can't open '%s'\n", fn); + else if (option_verbose > 1) + ast_verbose( "Only files can be included, not directories '%s'\n", strerror(errno)); + } else if ((f = fopen(fn, "r"))) { count++; if (option_debug) ast_log(LOG_DEBUG, "Parsing %s\n", fn);