Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/System
In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv7556
Modified Files:
System-Unix.cpp
Log Message:
Remove leading '0x' from hostid(), when presents.
Index: System-Unix.cpp
===================================================================
RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/System/System-Unix.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** System-Unix.cpp 17 Apr 2007 18:20:14 -0000 1.3
--- System-Unix.cpp 19 Apr 2007 20:54:14 -0000 1.4
***************
*** 100,104 ****
--- 100,115 ----
{
std::string r = exec0("hostid 2> /dev/null");
+ std::string tmp;
+
Chomp(r);
+
+ if (r.size()>2) {
+ tmp=r.substr(0, 2);
+ if (tmp=="0x") {
+ tmp=r.substr(2, r.size()-2);
+ r=tmp;
+ }
+ }
+
return(r);
}
|