Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-1.1
Commits
942772a0
Commit
942772a0
authored
Sep 22, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Save plugin cache to .cache/vlc/ rather than .cache/vlc/cache - fixes #1307
parent
770a2ac6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
30 deletions
+11
-30
src/modules/configuration.h
src/modules/configuration.h
+0
-1
src/modules/modules.c
src/modules/modules.c
+11
-29
No files found.
src/modules/configuration.h
View file @
942772a0
...
...
@@ -60,7 +60,6 @@ int IsConfigStringType( int type );
# define CONFIG_DIR ".vlc"
#endif
#define CONFIG_FILE "vlcrc"
#define PLUGINSCACHE_DIR "cache"
# ifdef __cplusplus
}
...
...
src/modules/modules.c
View file @
942772a0
...
...
@@ -1667,7 +1667,7 @@ static void CacheLoad( vlc_object_t *p_this )
char
*
psz_filename
,
*
psz_cachedir
;
FILE
*
file
;
int
i
,
j
,
i_size
,
i_read
;
char
p_cachestring
[
sizeof
(
PLUGINSCACHE_DIR
COPYRIGHT_MESSAGE
)];
char
p_cachestring
[
sizeof
(
"cache "
COPYRIGHT_MESSAGE
)];
char
p_cachelang
[
6
],
p_lang
[
6
];
int
i_cache
;
module_cache_t
**
pp_cache
=
0
;
...
...
@@ -1681,8 +1681,8 @@ static void CacheLoad( vlc_object_t *p_this )
return
;
}
i_size
=
asprintf
(
&
psz_filename
,
"%s"
DIR_SEP
"%s"
DIR_SEP
"%s"
,
psz_cachedir
,
PLUGINSCACHE_DIR
,
CacheName
()
);
i_size
=
asprintf
(
&
psz_filename
,
"%s"
DIR_SEP
"%s"
,
psz_cachedir
,
CacheName
()
);
if
(
i_size
<=
0
)
{
msg_Err
(
p_this
,
"out of memory"
);
...
...
@@ -1736,10 +1736,10 @@ static void CacheLoad( vlc_object_t *p_this )
fseek
(
file
,
sizeof
(
i_file_size
),
SEEK_SET
);
/* Check the file is a plugins cache */
i_size
=
sizeof
(
PLUGINSCACHE_DIR
COPYRIGHT_MESSAGE
)
-
1
;
i_size
=
sizeof
(
"cache "
COPYRIGHT_MESSAGE
)
-
1
;
i_read
=
fread
(
p_cachestring
,
1
,
i_size
,
file
);
if
(
i_read
!=
i_size
||
memcmp
(
p_cachestring
,
PLUGINSCACHE_DIR
COPYRIGHT_MESSAGE
,
i_size
)
)
memcmp
(
p_cachestring
,
"cache "
COPYRIGHT_MESSAGE
,
i_size
)
)
{
msg_Warn
(
p_this
,
"This doesn't look like a valid plugins cache"
);
fclose
(
file
);
...
...
@@ -2021,7 +2021,7 @@ static void CacheSave( vlc_object_t *p_this )
"# For information about cache directory tags, see:
\r\n
"
"# http://www.brynosaurus.com/cachedir/
\r\n
"
;
char
*
psz_
filename
,
*
psz_
cachedir
;
char
*
psz_cachedir
;
FILE
*
file
;
int
i
,
j
,
i_cache
;
module_cache_t
**
pp_cache
;
...
...
@@ -2035,26 +2035,10 @@ static void CacheSave( vlc_object_t *p_this )
return
;
}
psz_filename
=
(
char
*
)
malloc
(
sizeof
(
DIR_SEP
PLUGINSCACHE_DIR
DIR_SEP
)
+
strlen
(
psz_cachedir
)
+
strlen
(
CacheName
())
);
if
(
!
psz_filename
)
{
msg_Err
(
p_this
,
"out of memory"
);
return
;
}
sprintf
(
psz_filename
,
"%s"
,
psz_cachedir
);
config_CreateDir
(
p_this
,
psz_filename
);
strcat
(
psz_filename
,
DIR_SEP
PLUGINSCACHE_DIR
);
config_CreateDir
(
p_this
,
psz_filename
);
strcat
(
psz_filename
,
DIR_SEP
"CACHEDIR.TAG"
);
char
psz_filename
[
sizeof
(
DIR_SEP
)
+
32
+
strlen
(
psz_cachedir
)];
config_CreateDir
(
p_this
,
psz_cachedir
);
sprintf
(
psz_filename
,
"%s"
DIR_SEP
"CACHEDIR.TAG"
,
psz_cachedir
);
file
=
utf8_fopen
(
psz_filename
,
"wb"
);
if
(
file
)
{
...
...
@@ -2062,8 +2046,7 @@ static void CacheSave( vlc_object_t *p_this )
fclose
(
file
);
}
sprintf
(
psz_filename
,
"%s"
DIR_SEP
"%s"
DIR_SEP
"%s"
,
psz_cachedir
,
PLUGINSCACHE_DIR
,
CacheName
()
);
sprintf
(
psz_filename
,
"%s"
DIR_SEP
"%s"
,
psz_cachedir
,
CacheName
()
);
msg_Dbg
(
p_this
,
"saving plugins cache file %s"
,
psz_filename
);
...
...
@@ -2075,13 +2058,12 @@ static void CacheSave( vlc_object_t *p_this )
free
(
psz_filename
);
return
;
}
free
(
psz_filename
);
/* Empty space for file size */
fwrite
(
&
i_file_size
,
sizeof
(
char
),
sizeof
(
i_file_size
),
file
);
/* Contains version number */
fprintf
(
file
,
"%s"
,
PLUGINSCACHE_DIR
COPYRIGHT_MESSAGE
);
fprintf
(
file
,
"%s"
,
"cache "
COPYRIGHT_MESSAGE
);
/* Sub-version number (to avoid breakage in the dev version when cache
* structure changes) */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment