Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
CMake
CMake
Commits
8d41f97f
Commit
8d41f97f
authored
May 06, 2004
by
Bill Hoffman
Browse files
BUG: fix collapse full path to handle a file in the root directory
parent
6c0fb31d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Source/kwsys/SystemTools.cxx
View file @
8d41f97f
...
...
@@ -725,7 +725,7 @@ void SystemTools::ConvertToUnixSlashes(kwsys_stl::string& path)
}
// remove any trailing slash
if
(
path
.
size
()
&&
path
[
path
.
size
()
-
1
]
==
'/'
)
if
(
path
.
size
()
>
1
&&
path
[
path
.
size
()
-
1
]
==
'/'
)
{
path
=
path
.
substr
(
0
,
path
.
size
()
-
1
);
}
...
...
@@ -1364,6 +1364,12 @@ kwsys_stl::string SystemTools::CollapseFullPath(const char* in_relative,
kwsys_stl
::
string
dir
,
file
;
SystemTools
::
SplitProgramPath
(
in_relative
,
dir
,
file
,
false
);
if
(
dir
.
size
()
==
0
&&
in_relative
&&
strlen
(
in_relative
)
>
0
&&
in_relative
[
0
]
==
'/'
)
{
dir
=
"/"
;
}
#ifdef _WIN32
// Follow relative path.
...
...
@@ -1413,7 +1419,10 @@ kwsys_stl::string SystemTools::CollapseFullPath(const char* in_relative,
kwsys_stl
::
string
newPath
=
newDir
;
if
(
!
(
file
==
""
))
{
newPath
+=
"/"
;
if
(
!
(
newDir
.
size
()
==
1
&&
newDir
[
0
]
==
'/'
))
{
newPath
+=
"/"
;
}
newPath
+=
file
;
}
return
newPath
;
...
...
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