projects
/
ardour.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
26decc0
)
Fix opening session-archives
author
Robin Gareus
<robin@gareus.org>
Sat, 6 May 2017 16:31:18 +0000
(18:31 +0200)
committer
Robin Gareus
<robin@gareus.org>
Sat, 6 May 2017 16:31:18 +0000
(18:31 +0200)
libs/ardour/find_session.cc
patch
|
blob
|
history
diff --git
a/libs/ardour/find_session.cc
b/libs/ardour/find_session.cc
index 3301dfd20d9dbd86a228258150cd4dec34bc1934..05f88d83b35fccbd622463adc6f46e43f545ff3d 100644
(file)
--- a/
libs/ardour/find_session.cc
+++ b/
libs/ardour/find_session.cc
@@
-215,9
+215,16
@@
inflate_session (const std::string& zipfile, const std::string& target_dir, stri
error << _("Archive does not contain a session folder") << endmsg;
return 3;
}
- if (bn[bn.length() - 1] == '/') {
- bn = bn.substr (0, bn.length() - 1);
+
+ size_t sep = bn.find_first_of ('/');
+
+ if (sep == string::npos) {
+ error << _("Archive does not contain a session folder") << endmsg;
+ return 3;
}
+
+ bn = bn.substr (0, sep);
+
if (bn.empty ()) {
error << _("Archive does not contain a valid session structure") << endmsg;
return 4;