From 53159249456bc9e32d4b7d349913c1c929e4013b Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 26 Mar 2002 23:56:08 +0000 Subject: [PATCH] lilypond-1.3.91 --- config.hh.in | 8 +++++++- configure.in | 3 ++- flower/file-path.cc | 17 ++++++++++++++--- 3 files changed, 23 insertions(+), 5 deletions(-) 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) -- 2.39.5