melib/maildir: add message flag initialize in bytes

Maildir flags from filesystem path was not set correctly on Envelope
initialization in maildir backend
master
Manos Pitsidianakis 2020-09-09 22:53:12 +03:00
parent be57b65dae
commit c0c588be9c
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
2 changed files with 4 additions and 4 deletions

View File

@ -280,7 +280,7 @@ impl MailBackend for MaildirType {
} }
if let Ok(mut env) = Envelope::from_bytes( if let Ok(mut env) = Envelope::from_bytes(
unsafe { &Mmap::open_path(&file, Protection::Read)?.as_slice() }, unsafe { &Mmap::open_path(&file, Protection::Read)?.as_slice() },
None, Some(file.flags()),
) { ) {
env.set_hash(hash); env.set_hash(hash);
mailbox_index mailbox_index
@ -488,7 +488,7 @@ impl MailBackend for MaildirType {
unsafe { unsafe {
&Mmap::open_path(&pathbuf, Protection::Read)?.as_slice() &Mmap::open_path(&pathbuf, Protection::Read)?.as_slice()
}, },
None, Some(pathbuf.flags()),
) { ) {
env.set_hash(new_hash); env.set_hash(new_hash);
debug!("{}\t{:?}", new_hash, &pathbuf); debug!("{}\t{:?}", new_hash, &pathbuf);
@ -1162,7 +1162,7 @@ fn add_path_to_index(
//Mmap::open_path(self.path(), Protection::Read)? //Mmap::open_path(self.path(), Protection::Read)?
let mut env = Envelope::from_bytes( let mut env = Envelope::from_bytes(
unsafe { &Mmap::open_path(path, Protection::Read)?.as_slice() }, unsafe { &Mmap::open_path(path, Protection::Read)?.as_slice() },
None, Some(path.flags()),
)?; )?;
env.set_hash(env_hash); env.set_hash(env_hash);
debug!( debug!(

View File

@ -148,7 +148,7 @@ impl MaildirStream {
} }
match Envelope::from_bytes( match Envelope::from_bytes(
unsafe { &Mmap::open_path(&file, Protection::Read)?.as_slice() }, unsafe { &Mmap::open_path(&file, Protection::Read)?.as_slice() },
None, Some(file.flags()),
) { ) {
Ok(mut env) => { Ok(mut env) => {
env.set_hash(env_hash); env.set_hash(env_hash);