diff options
author | Tim Mayberry <mojofunk@gmail.com> | 2016-09-14 21:23:02 +1000 |
---|---|---|
committer | Tim Mayberry <mojofunk@gmail.com> | 2016-09-15 21:27:55 +1000 |
commit | 36d1d842df5925fe5cbc30083212043fe1877822 (patch) | |
tree | 1e8a18286549002b5bcdffd70d0ed7e3b4ac136c /libs/ardour/session_state.cc | |
parent | d36c41f128011e139eb7dccee0c7bbe274b8e4e2 (diff) |
Use g_rename() instead of ::rename() in Session::cleanup_sources
The paths are in UTF-8 encoding and ::rename expects paths in the system
codepage encoding so ::rename will fail for any paths that contain characters
that aren't in the system codepage.
This fixes Flush Wastebasket on Windows where paths contain characters that
aren't in the system codepage(usually most non-ascii characters).
Diffstat (limited to 'libs/ardour/session_state.cc')
-rw-r--r-- | libs/ardour/session_state.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 68ab485db7..f518d4e502 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -3306,7 +3306,7 @@ Session::cleanup_sources (CleanupReport& rep) if (0 == g_stat ((*x).c_str(), &statbuf)) { - if (::rename ((*x).c_str(), newpath.c_str()) != 0) { + if (::g_rename ((*x).c_str(), newpath.c_str()) != 0) { error << string_compose (_("cannot rename unused file source from %1 to %2 (%3)"), (*x), newpath, strerror (errno)) << endmsg; continue; } @@ -3327,7 +3327,7 @@ Session::cleanup_sources (CleanupReport& rep) peakpath, _path, strerror (errno)) << endmsg; /* try to back out */ - ::rename (newpath.c_str(), _path.c_str()); + ::g_rename (newpath.c_str(), _path.c_str()); goto out; } } |