summaryrefslogtreecommitdiffstats
path: root/hook.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2016-11-13 20:02:33 -0800
committerKevin McCarthy <kevin@8t8.us>2016-11-13 20:02:33 -0800
commit9bf6d74e9cc5a7b6b7a62fdefd6d953d60a422db (patch)
tree52c3e9f8c6c89cc6f79ec27765c3bc5c3b4f4864 /hook.c
parentb17cd67312913bc98269840652bc5c54eba9fc20 (diff)
Compress patch from the neomutt repository.
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.
Diffstat (limited to 'hook.c')
-rw-r--r--hook.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/hook.c b/hook.c
index 1b906c33..d0a111b2 100644
--- a/hook.c
+++ b/hook.c
@@ -24,6 +24,10 @@
#include "mailbox.h"
#include "mutt_crypt.h"
+#ifdef USE_COMPRESSED
+#include "compress.h"
+#endif
+
#include <limits.h>
#include <string.h>
#include <stdlib.h>
@@ -109,6 +113,14 @@ int mutt_parse_hook (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err)
memset (&pattern, 0, sizeof (pattern));
pattern.data = safe_strdup (path);
}
+#ifdef USE_COMPRESSED
+ else if (data & (MUTT_APPENDHOOK | MUTT_OPENHOOK | MUTT_CLOSEHOOK)) {
+ if (comp_valid_command (command.data) == 0) {
+ strfcpy (err->data, _("badly formatted command string"), err->dsize);
+ return -1;
+ }
+ }
+#endif
else if (DefaultHook && !(data & (MUTT_CHARSETHOOK | MUTT_ICONVHOOK | MUTT_ACCOUNTHOOK))
&& (!WithCrypto || !(data & MUTT_CRYPTHOOK))
)