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
Chuck Atkins
KWSys
Commits
a5ba260e
Commit
a5ba260e
authored
Mar 21, 2006
by
Sebastien Barre
Browse files
ENH: the arguments to this function were not checked in a robust way
parent
82879a82
Changes
1
Hide whitespace changes
Inline
Side-by-side
SystemTools.cxx
View file @
a5ba260e
...
@@ -1918,7 +1918,7 @@ kwsys_stl::string SystemTools::FindProgram(
...
@@ -1918,7 +1918,7 @@ kwsys_stl::string SystemTools::FindProgram(
const
kwsys_stl
::
vector
<
kwsys_stl
::
string
>&
userPaths
,
const
kwsys_stl
::
vector
<
kwsys_stl
::
string
>&
userPaths
,
bool
no_system_path
)
bool
no_system_path
)
{
{
if
(
!
nameIn
)
if
(
!
nameIn
||
!*
nameIn
)
{
{
return
""
;
return
""
;
}
}
...
@@ -2245,9 +2245,9 @@ bool SystemTools::FindProgramPath(const char* argv0,
...
@@ -2245,9 +2245,9 @@ bool SystemTools::FindProgramPath(const char* argv0,
const
char
*
installPrefix
)
const
char
*
installPrefix
)
{
{
kwsys_stl
::
vector
<
kwsys_stl
::
string
>
failures
;
kwsys_stl
::
vector
<
kwsys_stl
::
string
>
failures
;
kwsys_stl
::
string
self
=
argv0
;
kwsys_stl
::
string
self
=
argv0
?
argv0
:
""
;
failures
.
push_back
(
self
);
SystemTools
::
ConvertToUnixSlashes
(
self
);
SystemTools
::
ConvertToUnixSlashes
(
self
);
failures
.
push_back
(
argv0
);
self
=
SystemTools
::
FindProgram
(
self
.
c_str
());
self
=
SystemTools
::
FindProgram
(
self
.
c_str
());
if
(
!
SystemTools
::
FileExists
(
self
.
c_str
()))
if
(
!
SystemTools
::
FileExists
(
self
.
c_str
()))
{
{
...
@@ -2279,8 +2279,16 @@ bool SystemTools::FindProgramPath(const char* argv0,
...
@@ -2279,8 +2279,16 @@ bool SystemTools::FindProgramPath(const char* argv0,
{
{
failures
.
push_back
(
self
);
failures
.
push_back
(
self
);
kwsys_ios
::
ostringstream
msg
;
kwsys_ios
::
ostringstream
msg
;
msg
<<
"Can not find the command line program "
<<
exeName
<<
"
\n
"
;
msg
<<
"Can not find the command line program "
;
msg
<<
" argv[0] =
\"
"
<<
argv0
<<
"
\"\n
"
;
if
(
exeName
)
{
msg
<<
exeName
;
}
msg
<<
"
\n
"
;
if
(
argv0
)
{
msg
<<
" argv[0] =
\"
"
<<
argv0
<<
"
\"\n
"
;
}
msg
<<
" Attempted paths:
\n
"
;
msg
<<
" Attempted paths:
\n
"
;
kwsys_stl
::
vector
<
kwsys_stl
::
string
>::
iterator
i
;
kwsys_stl
::
vector
<
kwsys_stl
::
string
>::
iterator
i
;
for
(
i
=
failures
.
begin
();
i
!=
failures
.
end
();
++
i
)
for
(
i
=
failures
.
begin
();
i
!=
failures
.
end
();
++
i
)
...
...
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