Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Gauthier Quesnel
irritator
Commits
7b2b3be9
Commit
7b2b3be9
authored
May 17, 2021
by
Gauthier Quesnel
Browse files
dialog: fix linux get home directory
parent
0dab7c67
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/gui/dialog-file.cpp
View file @
7b2b3be9
...
...
@@ -51,10 +51,10 @@ get_home_directory()
std
::
vector
<
char
>
buf
(
size
,
'\0'
);
struct
passwd
pwd
;
struct
passwd
*
result
;
struct
passwd
*
result
=
nullptr
;
const
auto
s
=
getpwuid_r
(
getpid
(),
&
pwd
,
buf
.
data
(),
size
,
&
result
);
if
(
!
result
)
if
(
s
||
!
result
)
return
std
::
nullopt
;
return
std
::
filesystem
::
path
{
std
::
string_view
{
buf
.
data
()
}
};
...
...
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