13
0

Fix opening session-archives

This commit is contained in:
Robin Gareus 2017-05-06 18:31:18 +02:00
parent 26decc032c
commit 1f80f059be

View File

@ -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; error << _("Archive does not contain a session folder") << endmsg;
return 3; 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 ()) { if (bn.empty ()) {
error << _("Archive does not contain a valid session structure") << endmsg; error << _("Archive does not contain a valid session structure") << endmsg;
return 4; return 4;