Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
69a5df2f
Commit
69a5df2f
authored
Sep 12, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ConfigPath: remove the "~/" from the constructed path
This was building broken paths like "/home/foo/~/bar". Bug found by Maarten de Vries.
parent
1c65908c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
ConfigPath.cxx
src/ConfigPath.cxx
+9
-6
No files found.
src/ConfigPath.cxx
View file @
69a5df2f
...
@@ -82,10 +82,6 @@ ParsePath(const char *path, Error &error)
...
@@ -82,10 +82,6 @@ ParsePath(const char *path, Error &error)
{
{
assert
(
path
!=
nullptr
);
assert
(
path
!=
nullptr
);
Path
path2
=
Path
::
FromUTF8
(
path
,
error
);
if
(
path2
.
IsNull
())
return
Path
::
Null
();
#ifndef WIN32
#ifndef WIN32
if
(
path
[
0
]
==
'~'
)
{
if
(
path
[
0
]
==
'~'
)
{
Path
home
=
Path
::
Null
();
Path
home
=
Path
::
Null
();
...
@@ -105,12 +101,19 @@ ParsePath(const char *path, Error &error)
...
@@ -105,12 +101,19 @@ ParsePath(const char *path, Error &error)
home
=
GetHome
(
user
,
error
);
home
=
GetHome
(
user
,
error
);
g_free
(
user
);
g_free
(
user
);
path
=
slash
;
if
(
slash
==
nullptr
)
return
home
;
path
=
slash
+
1
;
}
}
if
(
home
.
IsNull
())
if
(
home
.
IsNull
())
return
Path
::
Null
();
return
Path
::
Null
();
Path
path2
=
Path
::
FromUTF8
(
path
,
error
);
if
(
path2
.
IsNull
())
return
Path
::
Null
();
return
Path
::
Build
(
home
,
path2
);
return
Path
::
Build
(
home
,
path2
);
}
else
if
(
!
g_path_is_absolute
(
path
))
{
}
else
if
(
!
g_path_is_absolute
(
path
))
{
error
.
Format
(
path_domain
,
error
.
Format
(
path_domain
,
...
@@ -118,7 +121,7 @@ ParsePath(const char *path, Error &error)
...
@@ -118,7 +121,7 @@ ParsePath(const char *path, Error &error)
return
Path
::
Null
();
return
Path
::
Null
();
}
else
{
}
else
{
#endif
#endif
return
path2
;
return
Path
::
FromUTF8
(
path
,
error
)
;
#ifndef WIN32
#ifndef WIN32
}
}
#endif
#endif
...
...
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