#include <sys/types.h>
#include <sys/stat.h>
-#include <pbd/error.h>
-#include <pbd/pathscanner.h>
-#include <pbd/stl_delete.h>
+#include <glibmm/miscutils.h>
+#include "pbd/error.h"
+#include "pbd/pathscanner.h"
+#include "pbd/stl_delete.h"
+
+using namespace std;
using namespace PBD;
vector<string *> *
struct dirent *finfo;
char *pathcopy = strdup (dirpath.c_str());
char *thisdir;
- char fullpath[PATH_MAX+1];
+ string fullpath;
string search_str;
string *newstr;
long nfound = 0;
(finfo->d_name[0] == '.' && finfo->d_name[1] == '.' && finfo->d_name[2] == '\0')) {
continue;
}
-
- snprintf (fullpath, sizeof(fullpath), "%s/%s",
- thisdir, finfo->d_name);
+
+ fullpath = Glib::build_filename (thisdir, finfo->d_name);
struct stat statbuf;
- if (stat (fullpath, &statbuf) < 0) {
+ if (stat (fullpath.c_str(), &statbuf) < 0) {
continue;
}
continue;
}
}
-
+
if (return_fullpath) {
newstr = new string (fullpath);
} else {
string *
PathScanner::find_first (const string &dirpath,
bool (*filter)(const string &, void *),
- void *arg,
+ void * /*arg*/,
bool match_fullpath,
bool return_fullpath)
{