]> git.sesse.net Git - vlc/commitdiff
Store the plugin file name in the cache once rather than twice
authorRémi Denis-Courmont <remi@remlab.net>
Sat, 13 Aug 2011 20:12:39 +0000 (23:12 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sat, 13 Aug 2011 20:12:39 +0000 (23:12 +0300)
src/modules/cache.c

index bf3ce4b137a752eddd9035e0c725515f93acceb4..16997a0c50305e6cd0443d7b279f82e4c1d0f45e 100644 (file)
@@ -229,7 +229,6 @@ size_t CacheLoad( vlc_object_t *p_this, const char *dir, module_cache_t **r )
         if (CacheLoadConfig (module, file) != VLC_SUCCESS)
             goto error;
 
-        LOAD_STRING(module->psz_filename);
         LOAD_STRING(module->domain);
         if (module->domain != NULL)
             vlc_bindtextdomain (module->domain);
@@ -515,7 +514,6 @@ static int CacheSaveBank (FILE *file, const module_cache_t *cache,
         if (CacheSaveConfig (file, module))
             goto error;
 
-        SAVE_STRING(module->psz_filename);
         SAVE_STRING(module->domain);
 
         i_submodule = module->submodule_count;
@@ -649,12 +647,16 @@ module_t *CacheFind (module_cache_t *cache, size_t count,
 {
     while (count > 0)
     {
-        if (!strcmp (cache->path, path)
+        if (cache->path != NULL
+         && !strcmp (cache->path, path)
          && cache->mtime == st->st_mtime
          && cache->size == st->st_size)
        {
             module_t *module = cache->p_module;
-            cache->p_module = NULL; /* Return NULL next time */
+            cache->p_module = NULL;
+
+            module->psz_filename = cache->path;
+            cache->path = NULL;
             return module;
        }
        cache++;