summaryrefslogtreecommitdiffstats
path: root/compress.h
AgeCommit message (Collapse)Author
2016-11-13Create mx_ops.sync operation. Refactor compress to use the mx_ops.sync.Kevin McCarthy
Change compress.sync_mailbox() to lock the compressed mailbox around both the tempfile sync and compress operations. This will prevent changes made inbetween the two syncs from being overwritten. Thanks to Damien Riegel for his original patch refactoring mx_ops.sync, which this patch is partially based upon.
2016-11-13Compress: fix several logic and memory bugs.Kevin McCarthy
setup_paths leaks memory: realpath is already set in mx_open_mailbox() restore_paths is unneeded. mx_fastclose_mailbox() will free stuff, and nothing is looking at the path once we are closing or aborting. Make a copy of the hooks. Otherwise 'unhook *' will leave dangling pointers. Add compress_info freeing inside mx_fastclose_mailbox(). Only free inside compress.c when we want to prevent close() from doing anything. close_mailbox() didn't preserve ctx->path on error. execute_command() didn't return an error if the mutt_system() command failed. mx_open_mailbox_append() should check mutt_comp_can_append() only for the case that the mailbox doesn't exist. When it exists, mx_get_magic() has already looked at the file contents before checking for matching open_hooks. In open_append_mailbox() if no append hook is defined, it should't call ci->open() if the mailbox doesn't exist. It should act just like append and create a temporary file. check_mailbox() needs more work. For now, at least have it properly close the mailbox on error.
2016-11-13Compress: prefix external functions with "mutt_"Kevin McCarthy
Also, include compress.h in compress.c so the mx_comp_ops doesn't need to be redeclared.
2016-11-13Compress patch from the neomutt repository.Kevin McCarthy
With the following changes: - po/de.po changes trimmed to just the compress additions. - Move the sample muttrc to contrib, and add it to the Makefile.am so it is distributed. Remove the sample vimrc. - Remove extra fluff from manual. Thanks to Roland Rosenfeld for the original patch, and to the NeoMutt team for their work cleaning up the patch.