#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
# 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,
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"
DEBUG_OUT << path << "? ";
+#if 0
/*
Check if directory. TODO: encapsulate for autoconf
*/
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)
}
/**
- Add an directory, return false if failed
+ Add a directory, return false if failed
*/
bool
File_path::try_add (String s)