From: Jan Nieuwenhuizen Date: Mon, 25 Sep 2000 08:27:50 +0000 (+0200) Subject: patch::: 1.3.90.jcn1 X-Git-Tag: release/1.3.91~1 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=77480597ed7c2654444535ac9c6f7636899dd322;p=lilypond.git patch::: 1.3.90.jcn1 1.3.90.jcn1 =========== * Use S_ISDIR () and check for stat.h. --- diff --git a/CHANGES b/CHANGES index dc84c63d28..1ebf8ec8e8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ +1.3.90.jcn1 +=========== + +* Use S_ISDIR () and check for stat.h. + 1.3.89.jcn1 =========== diff --git a/VERSION b/VERSION index ce0904ffd5..2df89940ae 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 PATCH_LEVEL=90 -MY_PATCH_LEVEL= +MY_PATCH_LEVEL=jcn1 # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/config.hh.in b/config.hh.in index a24a0584cd..be0e04a8f7 100644 --- a/config.hh.in +++ b/config.hh.in @@ -44,4 +44,10 @@ #define PATHSEP '@PATHSEP@' /* define if you have assert */ -#define HAVE_ASSERT_H 1 +#define HAVE_ASSERT_H 0 + +/* define if you have sys/stat.h */ +#define HAVE_SYS_STAT_H 0 + +/* define if you have sys/stat.h */ +#define STAT_MACROS_BROKEN 0 diff --git a/configure.in b/configure.in index f19b156e36..aa3f16f08f 100644 --- a/configure.in +++ b/configure.in @@ -14,7 +14,8 @@ AC_CONFIG_SUBDIRS(stepmake) # Uncomment the configuration options your package needs. AC_STEPMAKE_COMPILE # AC_HAVE_HEADERS(limits.h malloc.h string.h unistd.h values.h) -AC_HAVE_HEADERS(assert.h) +AC_HAVE_HEADERS(assert.h sys/stat.h) +AC_HEADER_STAT printing_b=no AC_ARG_ENABLE(printing, diff --git a/flower/file-path.cc b/flower/file-path.cc index 501554ea65..80c34db4c1 100644 --- a/flower/file-path.cc +++ b/flower/file-path.cc @@ -2,12 +2,13 @@ path.cc - manipulation of paths and filenames. */ - +#include "config.h" #include #include +#if HAVE_SYS_STAT_H #include +#endif -#include "config.h" #include "file-path.hh" #include "flower-debug.hh" @@ -102,6 +103,7 @@ File_path::find (String nm) const DEBUG_OUT << path << "? "; +#if 0 /* Check if directory. TODO: encapsulate for autoconf */ @@ -111,6 +113,15 @@ File_path::find (String nm) const if (!(sbuf.st_mode & __S_IFREG)) continue; +#endif +#if !STAT_MACROS_BROKEN + struct stat sbuf; + if (stat (path.ch_C (), &sbuf) == ENOENT) + continue; + + if (S_ISDIR (sbuf.st_mode)) + continue; +#endif FILE *f = fopen (path.ch_C(), "r"); // ugh! if (f) @@ -125,7 +136,7 @@ File_path::find (String nm) const } /** - Add an directory, return false if failed + Add a directory, return false if failed */ bool File_path::try_add (String s)