int
inflate_session (const std::string& zipfile, const std::string& target_dir, string& path, string& snapshot)
{
- if (zipfile.find (".tar.xz") == string::npos) {
+ if (zipfile.find (session_archive_suffix) == string::npos) {
return 1;
}
size_t sep = bn.find_first_of ('/');
- if (sep == string::npos) {
- error << _("Archive does not contain a session folder") << endmsg;
- return 3;
+ if (sep != string::npos) {
+ bn = bn.substr (0, sep);
}
- bn = bn.substr (0, sep);
-
if (bn.empty ()) {
error << _("Archive does not contain a valid session structure") << endmsg;
return 4;
case 0:
return _("No Error");
case 1:
- return _("File extension is not .tar.xz");
+ return string_compose (_("File extension is not %1"), session_archive_suffix);
case 2:
return _("Archive is empty");
case 3: