# vi: ft=diff This patch by Manuel Estrada Sainz is an improvement to the compressed folder patch. It was received at Debian's BTS, Bug#210429. * Patch last synced with upstream: - Date: unknown (mutt_1.5.6-20040523+1) - File: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=210429&msg=11 * Changes made: NONE. == END PATCH --- mutt.orig/compress.c 2003-09-11 19:26:34.000000000 +0200 +++ mutt/compress.c 2003-09-11 19:58:05.000000000 +0200 @@ -98,11 +98,23 @@ int mutt_can_append_compressed (const char *path) { int magic; if (is_new (path)) - return (find_compress_hook (M_CLOSEHOOK, path) ? 1 : 0); + { + char *dir_path = safe_strdup(path); + char *aux = strrchr(dir_path, '/'); + int dir_valid = 1; + if (aux) + { + *aux='\0'; + if (access(dir_path, W_OK|X_OK)) + dir_valid = 0; + } + safe_free((void**)&dir_path); + return dir_valid && (find_compress_hook (M_CLOSEHOOK, path) ? 1 : 0); + } magic = mx_get_magic (path); if (magic != 0 && magic != M_COMPRESSED) return 0;