Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Daniel Pfeifer
KWSys
Commits
24738fc2
Commit
24738fc2
authored
Oct 08, 2009
by
Zach
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trimmed off the newline from sw_vers output on mac, it could cause xml parsing errors if left in
parent
94040305
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
SystemInformation.cxx
SystemInformation.cxx
+21
-0
kwsysDateStamp.cmake
kwsysDateStamp.cmake
+1
-1
No files found.
SystemInformation.cxx
View file @
24738fc2
...
...
@@ -243,6 +243,7 @@ protected:
// For Mac
bool
ParseSysCtl
();
void
CallSwVers
();
void
TrimNewline
(
kwsys_stl
::
string
&
);
kwsys_stl
::
string
ExtractValueFromSysCtl
(
const
char
*
word
);
kwsys_stl
::
string
SysCtlBuffer
;
...
...
@@ -3390,6 +3391,7 @@ void SystemInformationImplementation::CallSwVers()
args
.
push_back
(
"-productName"
);
args
.
push_back
(
0
);
output
=
this
->
RunProcess
(
args
);
this
->
TrimNewline
(
output
);
this
->
OSName
=
output
;
args
.
clear
();
...
...
@@ -3397,6 +3399,7 @@ void SystemInformationImplementation::CallSwVers()
args
.
push_back
(
"-productVersion"
);
args
.
push_back
(
0
);
output
=
this
->
RunProcess
(
args
);
this
->
TrimNewline
(
output
);
this
->
OSRelease
=
output
;
args
.
clear
();
...
...
@@ -3404,10 +3407,28 @@ void SystemInformationImplementation::CallSwVers()
args
.
push_back
(
"-buildVersion"
);
args
.
push_back
(
0
);
output
=
this
->
RunProcess
(
args
);
this
->
TrimNewline
(
output
);
this
->
OSVersion
=
output
;
#endif
}
void
SystemInformationImplementation
::
TrimNewline
(
kwsys_stl
::
string
&
output
)
{
// remove \r
kwsys_stl
::
string
::
size_type
pos
=
0
;
while
((
pos
=
output
.
find
(
"
\r
"
,
pos
))
!=
kwsys_stl
::
string
::
npos
)
{
output
.
erase
(
pos
);
}
// remove \n
pos
=
0
;
while
((
pos
=
output
.
find
(
"
\n
"
,
pos
))
!=
kwsys_stl
::
string
::
npos
)
{
output
.
erase
(
pos
);
}
}
/** Return true if the machine is 64 bits */
bool
SystemInformationImplementation
::
Is64Bits
()
{
...
...
kwsysDateStamp.cmake
View file @
24738fc2
...
...
@@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2009)
SET
(
KWSYS_DATE_STAMP_MONTH 10
)
# KWSys version date day component. Format is DD.
SET
(
KWSYS_DATE_STAMP_DAY 0
6
)
SET
(
KWSYS_DATE_STAMP_DAY 0
8
)
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