projects
/
libs
/
core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
df74f89
)
Recognize either separator as the root component
author
Mikko Rasa
<tdb@tdb.fi>
Mon, 9 Jul 2012 16:32:17 +0000
(19:32 +0300)
committer
Mikko Rasa
<tdb@tdb.fi>
Mon, 9 Jul 2012 16:32:17 +0000
(19:32 +0300)
source/fs/path.cpp
patch
|
blob
|
history
diff --git
a/source/fs/path.cpp
b/source/fs/path.cpp
index 99bcc8bfe216b13101ce51f077ed12d7efd281d4..703be2b404744cbe76515ca4ebf40c4226649267 100644
(file)
--- a/
source/fs/path.cpp
+++ b/
source/fs/path.cpp
@@
-100,7
+100,7
@@
Path &Path::operator/=(const Path &p)
void Path::add_component(const string &comp)
{
void Path::add_component(const string &comp)
{
- if(comp.size()==1 &&
comp[0]==DIRSEP
)
+ if(comp.size()==1 &&
(comp[0]=='/' || comp[0]=='\\')
)
{
// Replace the path with the root directory
#ifdef WIN32
{
// Replace the path with the root directory
#ifdef WIN32
@@
-113,7
+113,7
@@
void Path::add_component(const string &comp)
else
#endif
{
else
#endif
{
- path
= comp
;
+ path
.assign(1, DIRSEP)
;
separators.clear();
separators.push_back(0);
}
separators.clear();
separators.push_back(0);
}