summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2005-02-24 15:31:17 (GMT)
committerBrad King <brad.king@kitware.com>2005-02-24 15:31:17 (GMT)
commitdf301a254204b009ae334a6236b583997301232e (patch)
treeb286df526cf6b3a19f9e7c2e62f30da6fde5f572 /Source/cmMakefile.cxx
parent33024e8ff6b21a6fe3b4b7f5ef4d4354f1bbda58 (diff)
downloadCMake-df301a254204b009ae334a6236b583997301232e.zip
CMake-df301a254204b009ae334a6236b583997301232e.tar.gz
CMake-df301a254204b009ae334a6236b583997301232e.tar.bz2
BUG: Fixed GetCacheMinorVersion to not always return 0.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx22
1 files changed, 16 insertions, 6 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 25671c9..7c863d1 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -90,20 +90,30 @@ const char* cmMakefile::GetReleaseVersion()
unsigned int cmMakefile::GetCacheMajorVersion()
{
- if(!this->GetCacheManager()->GetCacheValue("CMAKE_CACHE_MAJOR_VERSION"))
+ if(const char* vstr =
+ this->GetCacheManager()->GetCacheValue("CMAKE_CACHE_MAJOR_VERSION"))
{
- return 0;
+ unsigned int v=0;
+ if(sscanf(vstr, "%u", &v) == 1)
+ {
+ return v;
+ }
}
- return atoi(this->GetCacheManager()->GetCacheValue("CMAKE_CACHE_MAJOR_VERSION"));
+ return 0;
}
unsigned int cmMakefile::GetCacheMinorVersion()
{
- if(!this->GetCacheManager()->GetCacheValue("Cmake_Cache_MINOR_VERSION"))
+ if(const char* vstr =
+ this->GetCacheManager()->GetCacheValue("CMAKE_CACHE_MINOR_VERSION"))
{
- return 0;
+ unsigned int v=0;
+ if(sscanf(vstr, "%u", &v) == 1)
+ {
+ return v;
+ }
}
- return atoi(this->GetCacheManager()->GetCacheValue("CMAKE_CACHE_MINOR_VERSION"));
+ return 0;
}