]> git.llucax.com Git - software/mutt-debian.git/blob - debian/patches/features/compressed-folders.ranty-fix
Include, commented, not-applied/* patches in series.
[software/mutt-debian.git] / debian / patches / features / compressed-folders.ranty-fix
1 # vi: ft=diff
2 This patch by Manuel Estrada Sainz <ranty@debian.org> is an improvement
3 to the compressed folder patch.
4
5 It was received at Debian's BTS, Bug#210429.
6
7 * Patch last synced with upstream:
8   - Date: unknown (mutt_1.5.6-20040523+1)
9   - File: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=210429&msg=11
10
11 * Changes made: NONE.
12   
13 == END PATCH
14 --- mutt.orig/compress.c        2003-09-11 19:26:34.000000000 +0200
15 +++ mutt/compress.c             2003-09-11 19:58:05.000000000 +0200
16 @@ -98,11 +98,23 @@
17  int mutt_can_append_compressed (const char *path)
18  {
19    int magic;
20  
21    if (is_new (path))
22 -    return (find_compress_hook (M_CLOSEHOOK, path) ? 1 : 0);
23 +  {
24 +    char *dir_path = safe_strdup(path);
25 +    char *aux = strrchr(dir_path, '/');
26 +    int dir_valid = 1;
27 +    if (aux)
28 +    {
29 +      *aux='\0';
30 +      if (access(dir_path, W_OK|X_OK))
31 +        dir_valid = 0;
32 +    }
33 +    safe_free((void**)&dir_path);
34 +    return dir_valid && (find_compress_hook (M_CLOSEHOOK, path) ? 1 : 0);
35 +  }
36  
37    magic = mx_get_magic (path);
38  
39    if (magic != 0 && magic != M_COMPRESSED)
40      return 0;
41