Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
45973ce2
Commit
45973ce2
authored
Feb 12, 2006
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
utfeightize psz_homedir
parent
2eb7e0f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
22 deletions
+15
-22
src/misc/configuration.c
src/misc/configuration.c
+15
-22
No files found.
src/misc/configuration.c
View file @
45973ce2
...
...
@@ -23,6 +23,7 @@
#include <vlc/vlc.h>
#include "vlc_keys.h"
#include "charset.h"
#include <stdio.h>
/* sprintf() */
#include <stdlib.h>
/* free(), strtol() */
...
...
@@ -1713,7 +1714,7 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[],
*****************************************************************************/
static
char
*
GetDir
(
vlc_bool_t
b_appdata
)
{
char
*
p
_tmp
,
*
p_homedir
=
NULL
;
char
*
p
sz_localhome
=
NULL
;
#if defined(HAVE_GETPWUID)
struct
passwd
*
p_pw
=
NULL
;
...
...
@@ -1745,21 +1746,18 @@ static char *GetDir( vlc_bool_t b_appdata )
_T
(
"SHGetFolderPathA"
)
);
if
(
SHGetFolderPath
!=
NULL
)
{
p_homedir
=
(
char
*
)
malloc
(
MAX_PATH
);
if
(
!
p_homedir
)
return
NULL
;
char
psz_ACPhome
[
MAX_PATH
];
/* get the "Application Data" folder for the current user */
if
(
S_OK
==
SHGetFolderPath
(
NULL
,
(
b_appdata
?
CSIDL_APPDATA
:
CSIDL_PROFILE
)
|
CSIDL_FLAG_CREATE
,
NULL
,
SHGFP_TYPE_CURRENT
,
p
_homedir
)
)
p
sz_ACPhome
)
)
{
FreeLibrary
(
shfolder_dll
);
return
p_homedir
;
return
FromLocaleDup
(
psz_ACPhome
)
;
}
free
(
p_homedir
);
p_homedir
=
NULL
;
}
FreeLibrary
(
shfolder_dll
);
}
...
...
@@ -1775,11 +1773,10 @@ static char *GetDir( vlc_bool_t b_appdata )
/* get the "Application Data" folder for the current user */
if
(
SHGetSpecialFolderPath
(
NULL
,
p_whomedir
,
CSIDL_APPDATA
,
1
)
)
{
p_homedir
=
(
char
*
)
malloc
(
MAX_PATH
);
if
(
!
p_homedir
)
return
NULL
;
char
psz_ACPhome
[
2
*
MAX_PATH
];
sprintf
(
p
_homedir
,
"%ls"
,
p_whomedir
);
return
p_homedir
;
sprintf
(
p
sz_ACPhome
,
"%ls"
,
p_whomedir
);
return
FromLocaleDup
(
p_ACPhome
)
;
}
#endif
...
...
@@ -1787,24 +1784,20 @@ static char *GetDir( vlc_bool_t b_appdata )
if
(
(
p_pw
=
getpwuid
(
getuid
()
)
)
==
NULL
)
#endif
{
if
(
(
p_tmp
=
getenv
(
"HOME"
)
)
==
NULL
)
psz_localhome
=
getenv
(
"HOME"
);
if
(
psz_localhome
==
NULL
)
{
if
(
(
p_tmp
=
getenv
(
"TMP"
)
)
==
NULL
)
{
p_tmp
=
"/tmp"
;
}
psz_localhome
=
getenv
(
"TMP"
);
if
(
psz_localhome
==
NULL
)
psz_localhome
=
"/tmp"
;
}
p_homedir
=
strdup
(
p_tmp
);
}
#if defined(HAVE_GETPWUID)
else
{
p_homedir
=
strdup
(
p_pw
->
pw_dir
);
}
psz_localhome
=
p_pw
->
pw_dir
;
#endif
return
p_homedir
;
return
FromLocaleDup
(
psz_localhome
)
;
}
char
*
config_GetHomeDir
(
void
)
...
...
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