path.cc - manipulation of paths and filenames.
*/
+
#include <stdio.h>
+#include <errno.h>
+#include <sys/stat.h>
#include "config.h"
#include "file-path.hh"
path += nm;
DEBUG_OUT << path << "? ";
+
+ /*
+ Check if directory. TODO: encapsulate for autoconf
+ */
+ struct stat sbuf;
+ if (stat (path.ch_C(), &sbuf) == ENOENT)
+ continue;
+
+ if (!(sbuf.st_mode & __S_IFREG))
+ continue;
+
FILE *f = fopen (path.ch_C(), "r"); // ugh!
if (f)
{