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
e3908c8d
Commit
e3908c8d
authored
Feb 25, 2015
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fs/Traits: add constant CURRENT_DIRECTORY
parent
81c49fba
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
2 deletions
+7
-2
CheckFile.cxx
src/fs/CheckFile.cxx
+2
-1
Traits.cxx
src/fs/Traits.cxx
+1
-1
Traits.hxx
src/fs/Traits.hxx
+4
-0
No files found.
src/fs/CheckFile.cxx
View file @
e3908c8d
...
...
@@ -47,7 +47,8 @@ CheckDirectoryReadable(Path path_fs)
}
#ifndef WIN32
const
auto
x
=
AllocatedPath
::
Build
(
path_fs
,
"."
);
const
auto
x
=
AllocatedPath
::
Build
(
path_fs
,
PathTraitsFS
::
CURRENT_DIRECTORY
);
if
(
!
StatFile
(
x
,
st
)
&&
errno
==
EACCES
)
FormatError
(
config_domain
,
"No permission to traverse (
\"
execute
\"
) directory: %s"
,
...
...
src/fs/Traits.cxx
View file @
e3908c8d
...
...
@@ -74,7 +74,7 @@ GetParentPathImpl(typename Traits::const_pointer p)
typename
Traits
::
const_pointer
sep
=
Traits
::
FindLastSeparator
(
p
);
if
(
sep
==
nullptr
)
return
typename
Traits
::
string
(
"."
);
return
typename
Traits
::
string
(
Traits
::
CURRENT_DIRECTORY
);
if
(
sep
==
p
)
return
typename
Traits
::
string
(
p
,
p
+
1
);
#ifdef WIN32
...
...
src/fs/Traits.hxx
View file @
e3908c8d
...
...
@@ -47,6 +47,8 @@ struct PathTraitsFS {
static
constexpr
value_type
SEPARATOR
=
'/'
;
#endif
static
constexpr
const_pointer
CURRENT_DIRECTORY
=
"."
;
static
constexpr
bool
IsSeparator
(
value_type
ch
)
{
return
#ifdef WIN32
...
...
@@ -149,6 +151,8 @@ struct PathTraitsUTF8 {
static
constexpr
value_type
SEPARATOR
=
'/'
;
static
constexpr
const_pointer
CURRENT_DIRECTORY
=
"."
;
static
constexpr
bool
IsSeparator
(
value_type
ch
)
{
return
ch
==
SEPARATOR
;
}
...
...
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