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
46c39c8e
Commit
46c39c8e
authored
May 22, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make config_GetHomeDir return a const string too
parent
b152c831
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
14 deletions
+11
-14
include/vlc_main.h
include/vlc_main.h
+1
-1
src/config/configuration.h
src/config/configuration.h
+1
-1
src/config/dirs.c
src/config/dirs.c
+9
-11
src/libvlc-common.c
src/libvlc-common.c
+0
-1
No files found.
include/vlc_main.h
View file @
46c39c8e
...
...
@@ -37,7 +37,7 @@ struct libvlc_int_t
VLC_COMMON_MEMBERS
/* Global properties */
c
har
*
psz_homedir
;
///< user's home directory
c
onst
char
*
psz_homedir
;
///< user's home directory
global_stats_t
*
p_stats
;
///< Global statistics
...
...
src/config/configuration.h
View file @
46c39c8e
...
...
@@ -43,7 +43,7 @@ void config_UnsetCallbacks( module_config_t *, size_t );
#define config_LoadConfigFile(a,b) __config_LoadConfigFile(VLC_OBJECT(a),b)
int
__config_LoadCmdLine
(
vlc_object_t
*
,
int
*
,
const
char
*
[],
bool
);
c
har
*
config_GetHomeDir
(
void
);
c
onst
char
*
config_GetHomeDir
(
void
);
char
*
config_GetCustomConfigFile
(
libvlc_int_t
*
);
int
__config_LoadConfigFile
(
vlc_object_t
*
,
const
char
*
);
...
...
src/config/dirs.c
View file @
46c39c8e
...
...
@@ -92,6 +92,7 @@ const char *config_GetConfDir( void )
static
const
char
*
GetDir
(
bool
b_appdata
)
{
/* FIXME: a full memory page here - quite a waste... */
static
char
homedir
[
PATH_MAX
]
=
""
;
#if defined (WIN32)
...
...
@@ -153,43 +154,40 @@ static const char *GetDir( bool b_appdata )
/**
* Get the user's home directory
*/
char
*
config_GetHomeDir
(
void
)
c
onst
c
har
*
config_GetHomeDir
(
void
)
{
return
strdup
(
GetDir
(
false
)
);
return
GetDir
(
false
);
}
static
char
*
config_GetFooDir
(
const
char
*
xdg_name
,
const
char
*
xdg_default
)
{
char
*
psz_dir
;
#if defined(WIN32) || defined(__APPLE__) || defined(SYS_BEOS)
c
har
*
psz_parent
=
strdup
(
GetDir
(
true
)
);
c
onst
char
*
psz_parent
=
GetDir
(
true
);
if
(
asprintf
(
&
psz_dir
,
"%s"
DIR_SEP
CONFIG_DIR
,
psz_parent
)
==
-
1
)
psz_dir
=
NULL
;
free
(
psz_parent
);
(
void
)
xdg_name
;
(
void
)
xdg_default
;
#else
char
var
[
sizeof
(
"XDG__HOME"
)
+
strlen
(
xdg_name
)];
/* XDG Base Directory Specification - Version 0.6 */
snprintf
(
var
,
sizeof
(
var
),
"XDG_%s_HOME"
,
xdg_name
);
char
*
psz_home
=
getenv
(
var
);
psz_home
=
psz_home
?
FromLocaleDup
(
psz_home
)
:
NULL
;
const
char
*
psz_home
=
getenv
(
var
);
psz_home
=
psz_home
?
FromLocale
(
psz_home
)
:
NULL
;
if
(
psz_home
)
{
if
(
asprintf
(
&
psz_dir
,
"%s/vlc"
,
psz_home
)
==
-
1
)
psz_dir
=
NULL
;
goto
out
;
LocaleFree
(
psz_home
);
return
psz_dir
;
}
/* Try HOME, then fallback to non-XDG dirs */
psz_home
=
config_GetHomeDir
();
if
(
asprintf
(
&
psz_dir
,
"%s/%s/vlc"
,
psz_home
,
xdg_default
)
==
-
1
)
psz_dir
=
NULL
;
out:
free
(
psz_home
);
#endif
return
psz_dir
;
}
...
...
src/libvlc-common.c
View file @
46c39c8e
...
...
@@ -1065,7 +1065,6 @@ int libvlc_InternalDestroy( libvlc_int_t *p_libvlc, bool b_release )
/* Free module bank. It is refcounted, so we call this each time */
module_EndBank
(
p_libvlc
);
FREENULL
(
p_libvlc
->
psz_homedir
);
FREENULL
(
priv
->
psz_configfile
);
var_DelCallback
(
p_libvlc
,
"key-pressed"
,
vlc_key_to_action
,
p_libvlc
->
p_hotkeys
);
...
...
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