Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
a3d90e27
Commit
a3d90e27
authored
Aug 13, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not assume sysconf() returns a positive value
parent
191f0716
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
src/posix/dirs.c
src/posix/dirs.c
+10
-10
No files found.
src/posix/dirs.c
View file @
a3d90e27
...
...
@@ -72,22 +72,22 @@ static char *config_GetHomeDir (void)
{
/* 1/ Try $HOME */
const
char
*
home
=
getenv
(
"HOME"
);
if
(
home
!=
NULL
)
return
strdup
(
home
);
#if defined(HAVE_GETPWUID_R)
/* 2/ Try /etc/passwd */
char
buf
[
sysconf
(
_SC_GETPW_R_SIZE_MAX
)]
;
if
(
home
==
NULL
)
long
max
=
sysconf
(
_SC_GETPW_R_SIZE_MAX
)
;
if
(
max
!=
-
1
)
{
struct
passwd
pw
,
*
res
;
char
buf
[
max
];
struct
passwd
pwbuf
,
*
pw
;
if
(
!
getpwuid_r
(
getuid
(),
&
pw
,
buf
,
sizeof
(
buf
),
&
res
)
&&
res
)
home
=
pw
.
pw_dir
;
if
(
getpwuid_r
(
getuid
(),
&
pwbuf
,
buf
,
sizeof
(
buf
),
&
pw
)
==
0
&&
pw
!=
NULL
)
return
strdup
(
pw
->
pw_dir
);
}
#endif
if
(
!
home
)
return
NULL
;
return
strdup
(
home
);
return
NULL
;
}
static
char
*
config_GetAppDir
(
const
char
*
xdg_name
,
const
char
*
xdg_default
)
...
...
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