Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
CMake
CMake
Commits
ded4bc13
Commit
ded4bc13
authored
Feb 12, 2019
by
Brad King
1
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys: KWSys 2019-02-12 (44676809)
parents
9d2ab63a
f3999a21
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
29 additions
and
17 deletions
+29
-17
Source/kwsys/CommandLineArguments.hxx.in
Source/kwsys/CommandLineArguments.hxx.in
+3
-0
Source/kwsys/Directory.cxx
Source/kwsys/Directory.cxx
+2
-2
Source/kwsys/Glob.cxx
Source/kwsys/Glob.cxx
+1
-1
Source/kwsys/SystemInformation.cxx
Source/kwsys/SystemInformation.cxx
+1
-1
Source/kwsys/SystemInformation.hxx.in
Source/kwsys/SystemInformation.hxx.in
+3
-0
Source/kwsys/SystemTools.cxx
Source/kwsys/SystemTools.cxx
+16
-13
Source/kwsys/SystemTools.hxx.in
Source/kwsys/SystemTools.hxx.in
+3
-0
No files found.
Source/kwsys/CommandLineArguments.hxx.in
View file @
ded4bc13
...
...
@@ -62,6 +62,9 @@ public:
CommandLineArguments();
~CommandLineArguments();
CommandLineArguments(const CommandLineArguments&) = delete;
CommandLineArguments& operator=(const CommandLineArguments&) = delete;
/**
* Various argument types.
*/
...
...
Source/kwsys/Directory.cxx
View file @
ded4bc13
...
...
@@ -102,7 +102,7 @@ bool Directory::Load(const std::string& name)
# endif
char
*
buf
;
size_t
n
=
name
.
size
();
if
(
*
name
.
rbegin
()
==
'/'
||
*
name
.
rbegin
()
==
'\\'
)
{
if
(
name
.
back
()
==
'/'
||
name
.
back
()
==
'\\'
)
{
buf
=
new
char
[
n
+
1
+
1
];
sprintf
(
buf
,
"%s*"
,
name
.
c_str
());
}
else
{
...
...
@@ -144,7 +144,7 @@ unsigned long Directory::GetNumberOfFilesInDirectory(const std::string& name)
# endif
char
*
buf
;
size_t
n
=
name
.
size
();
if
(
*
name
.
rbegin
()
==
'/'
)
{
if
(
name
.
back
()
==
'/'
)
{
buf
=
new
char
[
n
+
1
+
1
];
sprintf
(
buf
,
"%s*"
,
name
.
c_str
());
}
else
{
...
...
Source/kwsys/Glob.cxx
View file @
ded4bc13
...
...
@@ -263,7 +263,7 @@ bool Glob::RecurseDirectory(std::string::size_type start,
}
}
else
{
if
(
!
this
->
Internals
->
Expressions
.
empty
()
&&
this
->
Internals
->
Expressions
.
rbegin
()
->
find
(
fname
))
{
this
->
Internals
->
Expressions
.
back
().
find
(
fname
))
{
this
->
AddFile
(
this
->
Internals
->
Files
,
realname
);
}
}
...
...
Source/kwsys/SystemInformation.cxx
View file @
ded4bc13
...
...
@@ -4620,7 +4620,7 @@ std::string SystemInformationImplementation::RunProcess(
// Run the application
kwsysProcess
*
gp
=
kwsysProcess_New
();
kwsysProcess_SetCommand
(
gp
,
&*
args
.
begin
());
kwsysProcess_SetCommand
(
gp
,
args
.
data
());
kwsysProcess_SetOption
(
gp
,
kwsysProcess_Option_HideWindow
,
1
);
kwsysProcess_Execute
(
gp
);
...
...
Source/kwsys/SystemInformation.hxx.in
View file @
ded4bc13
...
...
@@ -56,6 +56,9 @@ public:
SystemInformation();
~SystemInformation();
SystemInformation(const SystemInformation&) = delete;
SystemInformation& operator=(const SystemInformation&) = delete;
const char* GetVendorString();
const char* GetVendorID();
std::string GetTypeID();
...
...
Source/kwsys/SystemTools.cxx
View file @
ded4bc13
...
...
@@ -416,6 +416,9 @@ public:
{
}
~
Free
()
{
free
(
const_cast
<
envchar
*>
(
this
->
Env
));
}
Free
(
const
Free
&
)
=
delete
;
Free
&
operator
=
(
const
Free
&
)
=
delete
;
};
const
envchar
*
Release
(
const
envchar
*
env
)
...
...
@@ -473,7 +476,7 @@ void SystemTools::GetPath(std::vector<std::string>& path, const char* env)
}
// A hack to make the below algorithm work.
if
(
!
pathEnv
.
empty
()
&&
*
pathEnv
.
rbegin
()
!=
pathSep
)
{
if
(
!
pathEnv
.
empty
()
&&
pathEnv
.
back
()
!=
pathSep
)
{
pathEnv
+=
pathSep
;
}
std
::
string
::
size_type
start
=
0
;
...
...
@@ -1943,7 +1946,7 @@ void SystemTools::ConvertToUnixSlashes(std::string& path)
// a single /
pathCString
=
path
.
c_str
();
size_t
size
=
path
.
size
();
if
(
size
>
1
&&
*
path
.
rbegin
()
==
'/'
)
{
if
(
size
>
1
&&
path
.
back
()
==
'/'
)
{
// if it is c:/ then do not remove the trailing slash
if
(
!
((
size
==
3
&&
pathCString
[
1
]
==
':'
)))
{
path
.
resize
(
size
-
1
);
...
...
@@ -2692,7 +2695,7 @@ std::string SystemTools::FindName(const std::string& name,
for
(
std
::
vector
<
std
::
string
>::
iterator
i
=
path
.
begin
();
i
!=
path
.
end
();
++
i
)
{
std
::
string
&
p
=
*
i
;
if
(
p
.
empty
()
||
*
p
.
rbegin
()
!=
'/'
)
{
if
(
p
.
empty
()
||
p
.
back
()
!=
'/'
)
{
p
+=
"/"
;
}
}
...
...
@@ -2810,7 +2813,7 @@ std::string SystemTools::FindProgram(const std::string& name,
for
(
std
::
vector
<
std
::
string
>::
iterator
i
=
path
.
begin
();
i
!=
path
.
end
();
++
i
)
{
std
::
string
&
p
=
*
i
;
if
(
p
.
empty
()
||
*
p
.
rbegin
()
!=
'/'
)
{
if
(
p
.
empty
()
||
p
.
back
()
!=
'/'
)
{
p
+=
"/"
;
}
}
...
...
@@ -2888,7 +2891,7 @@ std::string SystemTools::FindLibrary(const std::string& name,
for
(
std
::
vector
<
std
::
string
>::
iterator
i
=
path
.
begin
();
i
!=
path
.
end
();
++
i
)
{
std
::
string
&
p
=
*
i
;
if
(
p
.
empty
()
||
*
p
.
rbegin
()
!=
'/'
)
{
if
(
p
.
empty
()
||
p
.
back
()
!=
'/'
)
{
p
+=
"/"
;
}
}
...
...
@@ -3234,10 +3237,10 @@ void SystemTools::AddTranslationPath(const std::string& a,
if
(
SystemTools
::
FileIsFullPath
(
path_b
)
&&
path_b
.
find
(
".."
)
==
std
::
string
::
npos
)
{
// Before inserting make sure path ends with '/'
if
(
!
path_a
.
empty
()
&&
*
path_a
.
rbegin
()
!=
'/'
)
{
if
(
!
path_a
.
empty
()
&&
path_a
.
back
()
!=
'/'
)
{
path_a
+=
'/'
;
}
if
(
!
path_b
.
empty
()
&&
*
path_b
.
rbegin
()
!=
'/'
)
{
if
(
!
path_b
.
empty
()
&&
path_b
.
back
()
!=
'/'
)
{
path_b
+=
'/'
;
}
if
(
!
(
path_a
==
path_b
))
{
...
...
@@ -3446,7 +3449,7 @@ std::string SystemTools::RelativePath(const std::string& local,
// between each entry that does not already have one
for
(
std
::
vector
<
std
::
string
>::
iterator
vit1
=
finalPath
.
begin
();
vit1
!=
finalPath
.
end
();
++
vit1
)
{
if
(
!
relativePath
.
empty
()
&&
*
relativePath
.
rbegin
()
!=
'/'
)
{
if
(
!
relativePath
.
empty
()
&&
relativePath
.
back
()
!=
'/'
)
{
relativePath
+=
"/"
;
}
relativePath
+=
*
vit1
;
...
...
@@ -3648,7 +3651,7 @@ void SystemTools::SplitPath(const std::string& p,
}
#endif
if
(
!
homedir
.
empty
()
&&
(
*
homedir
.
rbegin
()
==
'/'
||
*
homedir
.
rbegin
()
==
'\\'
))
{
(
homedir
.
back
()
==
'/'
||
homedir
.
back
()
==
'\\'
))
{
homedir
.
resize
(
homedir
.
size
()
-
1
);
}
SystemTools
::
SplitPath
(
homedir
,
components
);
...
...
@@ -4016,7 +4019,7 @@ bool SystemTools::LocateFileInDir(const char* filename, const char* dir,
filename_dir
=
SystemTools
::
GetFilenamePath
(
filename_dir
);
filename_dir_base
=
SystemTools
::
GetFilenameName
(
filename_dir
);
#if defined(_WIN32)
if
(
filename_dir_base
.
empty
()
||
*
filename_dir_base
.
rbegin
()
==
':'
)
if
(
filename_dir_base
.
empty
()
||
filename_dir_base
.
back
()
==
':'
)
#else
if
(
filename_dir_base
.
empty
())
#endif
...
...
@@ -4092,7 +4095,7 @@ bool SystemTools::GetShortPath(const std::string& path, std::string& shortPath)
std
::
string
tempPath
=
path
;
// create a buffer
// if the path passed in has quotes around it, first remove the quotes
if
(
!
path
.
empty
()
&&
path
[
0
]
==
'"'
&&
*
path
.
rbegin
()
==
'"'
)
{
if
(
!
path
.
empty
()
&&
path
[
0
]
==
'"'
&&
path
.
back
()
==
'"'
)
{
tempPath
=
path
.
substr
(
1
,
path
.
length
()
-
2
);
}
...
...
@@ -4169,7 +4172,7 @@ bool SystemTools::GetLineFromStream(std::istream& is, std::string& line,
bool
haveData
=
!
line
.
empty
()
||
!
is
.
eof
();
if
(
!
line
.
empty
())
{
// Avoid storing a carriage return character.
if
(
*
line
.
rbegin
()
==
'\r'
)
{
if
(
line
.
back
()
==
'\r'
)
{
line
.
resize
(
line
.
size
()
-
1
);
}
...
...
@@ -4307,7 +4310,7 @@ bool SystemTools::IsSubDirectory(const std::string& cSubdir,
if
(
subdir
.
size
()
<=
dir
.
size
()
||
dir
.
empty
())
{
return
false
;
}
bool
isRootPath
=
*
dir
.
rbegin
()
==
'/'
;
// like "/" or "C:/"
bool
isRootPath
=
dir
.
back
()
==
'/'
;
// like "/" or "C:/"
size_t
expectedSlashPosition
=
isRootPath
?
dir
.
size
()
-
1u
:
dir
.
size
();
if
(
subdir
[
expectedSlashPosition
]
!=
'/'
)
{
return
false
;
...
...
Source/kwsys/SystemTools.hxx.in
View file @
ded4bc13
...
...
@@ -54,6 +54,9 @@ class @KWSYS_NAMESPACE@_EXPORT SystemToolsManager
public:
SystemToolsManager();
~SystemToolsManager();
SystemToolsManager(const SystemToolsManager&) = delete;
SystemToolsManager& operator=(const SystemToolsManager&) = delete;
};
// This instance will show up in any translation unit that uses
...
...
Brad King
@brad.king
mentioned in commit
49a53cac
·
Feb 14, 2019
mentioned in commit
49a53cac
mentioned in commit 49a53cac87fe3a303a2794ccdd7c1b5cecd2d016
Toggle commit list
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