]> granicus.if.org Git - mutt/commitdiff
Always give realpath a shot at the hcache folder name. Remove other hacks.
authorBrendan Cully <brendan@kublai.com>
Wed, 14 Mar 2007 19:58:33 +0000 (12:58 -0700)
committerBrendan Cully <brendan@kublai.com>
Wed, 14 Mar 2007 19:58:33 +0000 (12:58 -0700)
hcache.c

index ef760d6ac6c7900bfbf91a26c0fbb3dceb399512..b5b3d59e4279e209614ac2776273a1db1c246bbe 100644 (file)
--- a/hcache.c
+++ b/hcache.c
@@ -770,13 +770,12 @@ mutt_hcache_store_raw (header_cache_t* h, const char* filename, void* data,
 }
 
 static char* get_foldername(const char *folder) {
-  size_t flen = mutt_strlen (folder);
   char *p = NULL;
   struct stat st;
 
-  /* if the folder exists and doesn't start with /,
-   * prepend cwd to always use the same hcache per folder */
-  if (stat (folder, &st) == 0 && flen > 0 && *folder != '/')
+  /* if the folder is local, canonify the path to avoid
+   * to ensure equivalent paths share the hcache */
+  if (stat (folder, &st) == 0)
   {
     p = safe_malloc (_POSIX_PATH_MAX+1);
     if (!realpath (folder, p))
@@ -784,10 +783,6 @@ static char* get_foldername(const char *folder) {
   } else
     p = safe_strdup (folder);
 
-  /* make sure we have no trailing / as added by tab completion */
-  if (flen > 0 && p[flen-1] == '/')
-    p[flen-1] = '\0';
-
   return p;
 }