mu-maildir: fix message_file_parts / empty flags

Remove the suffix part even with no flags.

Fixes: issue #2268
This commit is contained in:
Dirk-Jan C. Binnema 2022-05-31 23:41:50 +03:00
parent 022ae9c2e3
commit 26d64ec78f
2 changed files with 9 additions and 11 deletions

View File

@ -247,8 +247,6 @@ Mu::maildir_clear_links(const std::string& path)
return Ok();
}
Result<std::string>
Mu::maildir_from_path(const std::string& path, const std::string& root)
{
@ -303,7 +301,7 @@ message_file_parts(const std::string& file)
/* no suffix at all? */
if (pos == std::string::npos ||
pos >= file.length() - 3 ||
pos > file.length() - 3 ||
file[pos + 1] != '2' ||
file[pos + 2] != ',')
return FileParts{ file, ':', {}};
@ -579,8 +577,8 @@ Mu::maildir_determine_target(const std::string& old_path,
return Err(src.error());
const auto& [src_mdir, src_file, is_new] = *src;
/* if target_mdir is empty, we use the src_dir does not change
* (though cur/ maybe become new or vice-versa) */
/* if target_mdir is empty, the src_dir does not change (though cur/
* maybe become new or vice-versa) */
const auto dst_mdir{target_maildir.empty() ? src_mdir :
root_maildir_path + target_maildir};