]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.3.91
authorfred <fred>
Tue, 26 Mar 2002 23:56:08 +0000 (23:56 +0000)
committerfred <fred>
Tue, 26 Mar 2002 23:56:08 +0000 (23:56 +0000)
config.hh.in
configure.in
flower/file-path.cc

index a24a0584cd60f7af9c4ccac925580c74e3f4a11e..be0e04a8f7f6924548bc0d5a0c28c707cc0be6d7 100644 (file)
 #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
index f19b156e364cd12323e6e48500fa3824e86937e2..aa3f16f08f51dc0d967ac316fbac7d82375225cc 100644 (file)
@@ -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,
index 501554ea656580ef87c357412fa29bd5ad406dea..80c34db4c1701eb9e7dec6dbe065cdece72e9688 100644 (file)
@@ -2,12 +2,13 @@
    path.cc - manipulation of paths and filenames.
 */
 
-
+#include "config.h"
 #include <stdio.h>
 #include <errno.h>
+#if HAVE_SYS_STAT_H 
 #include <sys/stat.h>
+#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)