- const char *c = mutt_find_hook (type, path);
-
- return (!c || !*c) ? NULL : c;
+ int len = strlen(path);
+ if (len > 3 && !strcmp(path + len - 3, ".gz")) {
+ switch (type) {
+ case M_OPENHOOK: return "gzip -cd %f > %t";
+ case M_CLOSEHOOK: return "gzip -cd %t > %f";
+ case M_APPENDHOOK: return "gzip -cd %t >> %f";
+ default: return NULL;
+ }
+ }
+ if (len > 4 && !strcmp(path + len - 4, ".bz2")) {
+ switch (type) {
+ case M_OPENHOOK: return "bzip2 -cd %f > %t";
+ case M_CLOSEHOOK: return "bzip2 -cd %t > %f";
+ case M_APPENDHOOK: return "bzip2 -cd %t >> %f";
+ default: return NULL;
+ }
+ }
+ return NULL;