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
ce2b2036
Commit
ce2b2036
authored
Jan 20, 2008
by
Brad King
Browse files
BUG: Fix previous commit to not access empty strings out of bounds.
parent
9f982d7d
Changes
3
Show whitespace changes
Inline
Side-by-side
Source/cmFindLibraryCommand.cxx
View file @
ce2b2036
...
...
@@ -186,7 +186,7 @@ std::string cmFindLibraryCommand::FindLibrary(const char* name)
i
!=
this
->
SearchPaths
.
end
();
++
i
)
{
std
::
string
&
p
=
*
i
;
if
(
p
[
p
.
size
()
-
1
]
!=
'/'
)
if
(
p
.
empty
()
||
p
[
p
.
size
()
-
1
]
!=
'/'
)
{
p
+=
"/"
;
}
...
...
Source/cmFindPathCommand.cxx
View file @
ce2b2036
...
...
@@ -106,7 +106,7 @@ bool cmFindPathCommand::InitialPass(std::vector<std::string> const& argsIn)
i
!=
this
->
SearchPaths
.
end
();
++
i
)
{
std
::
string
&
p
=
*
i
;
if
(
p
[
p
.
size
()
-
1
]
!=
'/'
)
if
(
p
.
empty
()
||
p
[
p
.
size
()
-
1
]
!=
'/'
)
{
p
+=
"/"
;
}
...
...
Source/kwsys/SystemTools.cxx
View file @
ce2b2036
...
...
@@ -2117,7 +2117,7 @@ kwsys_stl::string SystemTools
i
!=
path
.
end
();
++
i
)
{
kwsys_stl
::
string
&
p
=
*
i
;
if
(
p
[
p
.
size
()
-
1
]
!=
'/'
)
if
(
p
.
empty
()
||
p
[
p
.
size
()
-
1
]
!=
'/'
)
{
p
+=
"/"
;
}
...
...
@@ -2249,7 +2249,7 @@ kwsys_stl::string SystemTools::FindProgram(
i
!=
path
.
end
();
++
i
)
{
kwsys_stl
::
string
&
p
=
*
i
;
if
(
p
[
p
.
size
()
-
1
]
!=
'/'
)
if
(
p
.
empty
()
||
p
[
p
.
size
()
-
1
]
!=
'/'
)
{
p
+=
"/"
;
}
...
...
@@ -2341,7 +2341,7 @@ kwsys_stl::string SystemTools
i
!=
path
.
end
();
++
i
)
{
kwsys_stl
::
string
&
p
=
*
i
;
if
(
p
[
p
.
size
()
-
1
]
!=
'/'
)
if
(
p
.
empty
()
||
p
[
p
.
size
()
-
1
]
!=
'/'
)
{
p
+=
"/"
;
}
...
...
Write
Preview
Supports
Markdown
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