remove hard-coded use of '/' in pathscanner code as dir separator (use glib instead)
git-svn-id: svn://localhost/ardour2/branches/3.0@8990 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
50b52d9a53
commit
3af81e63bf
@ -26,6 +26,8 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
#include <glibmm/miscutils.h>
|
||||||
|
|
||||||
#include "pbd/error.h"
|
#include "pbd/error.h"
|
||||||
#include "pbd/pathscanner.h"
|
#include "pbd/pathscanner.h"
|
||||||
#include "pbd/stl_delete.h"
|
#include "pbd/stl_delete.h"
|
||||||
@ -90,7 +92,7 @@ PathScanner::run_scan_internal (vector<string *> *result,
|
|||||||
struct dirent *finfo;
|
struct dirent *finfo;
|
||||||
char *pathcopy = strdup (dirpath.c_str());
|
char *pathcopy = strdup (dirpath.c_str());
|
||||||
char *thisdir;
|
char *thisdir;
|
||||||
char fullpath[PATH_MAX+1];
|
string fullpath;
|
||||||
string search_str;
|
string search_str;
|
||||||
string *newstr;
|
string *newstr;
|
||||||
long nfound = 0;
|
long nfound = 0;
|
||||||
@ -118,11 +120,10 @@ PathScanner::run_scan_internal (vector<string *> *result,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf (fullpath, sizeof(fullpath), "%s/%s",
|
fullpath = Glib::build_filename (thisdir, finfo->d_name);
|
||||||
thisdir, finfo->d_name);
|
|
||||||
|
|
||||||
struct stat statbuf;
|
struct stat statbuf;
|
||||||
if (stat (fullpath, &statbuf) < 0) {
|
if (stat (fullpath.c_str(), &statbuf) < 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user