mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-19 13:16:27 +01:00
fix crashes when handling files with ":" in their paths. Cost: cannot load old sessions with non-mono embedded files anymore
git-svn-id: svn://localhost/ardour2/trunk@1672 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
8aab3489da
commit
0eafb1f300
1 changed files with 21 additions and 1 deletions
|
|
@ -17,6 +17,11 @@
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <pbd/pthread_utils.h>
|
#include <pbd/pthread_utils.h>
|
||||||
#include <pbd/basename.h>
|
#include <pbd/basename.h>
|
||||||
#include <pbd/shortpath.h>
|
#include <pbd/shortpath.h>
|
||||||
|
|
@ -302,6 +307,21 @@ Editor::embed_sndfile (vector<Glib::ustring> paths, bool split, bool multiple_fi
|
||||||
*/
|
*/
|
||||||
|
|
||||||
path = linked_path;
|
path = linked_path;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
/* one possible reason is that its already linked */
|
||||||
|
|
||||||
|
if (errno == EEXIST) {
|
||||||
|
struct stat sb;
|
||||||
|
|
||||||
|
if (stat (linked_path.c_str(), &sb) == 0) {
|
||||||
|
if (sb.st_nlink > 1) { // its a hard link, assume its the one we want
|
||||||
|
path = linked_path;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* note that we temporarily truncated _id at the colon */
|
/* note that we temporarily truncated _id at the colon */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue