summaryrefslogtreecommitdiff
path: root/libs/pbd
diff options
context:
space:
mode:
Diffstat (limited to 'libs/pbd')
-rw-r--r--libs/pbd/filesystem.cc8
-rw-r--r--libs/pbd/pbd/filesystem.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/libs/pbd/filesystem.cc b/libs/pbd/filesystem.cc
index fc4676a38d..244acefe43 100644
--- a/libs/pbd/filesystem.cc
+++ b/libs/pbd/filesystem.cc
@@ -221,12 +221,12 @@ get_absolute_path (const path & p)
/** @return true if a and b have the same inode */
bool
-inodes_same (const path& a, const path& b)
+equivalent_paths (const std::string& a, const std::string& b)
{
struct stat bA;
- int const rA = g_stat (a.to_string().c_str(), &bA);
+ int const rA = g_stat (a.c_str(), &bA);
struct stat bB;
- int const rB = g_stat (b.to_string().c_str(), &bB);
+ int const rB = g_stat (b.c_str(), &bB);
return (rA == 0 && rB == 0 && bA.st_dev == bB.st_dev && bA.st_ino == bB.st_ino);
}
@@ -239,7 +239,7 @@ bool
path_is_within (path const & haystack, path needle)
{
while (1) {
- if (inodes_same (haystack, needle)) {
+ if (equivalent_paths (haystack.to_string(), needle.to_string())) {
return true;
}
diff --git a/libs/pbd/pbd/filesystem.h b/libs/pbd/pbd/filesystem.h
index aa9f9ef502..c347f3cc42 100644
--- a/libs/pbd/pbd/filesystem.h
+++ b/libs/pbd/pbd/filesystem.h
@@ -192,7 +192,7 @@ path get_absolute_path (const path &);
bool path_is_within (const path &, path);
-bool inodes_same (const path &, const path &);
+bool equivalent_paths (const std::string &, const std::string &);
} // namespace sys