summaryrefslogtreecommitdiffstats
path: root/Source/CPack/cmCPackCygwinSourceGenerator.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2008-03-13 01:54:27 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2008-03-13 01:54:27 (GMT)
commit042f4c334d854448852ede2a207e7e361e53c154 (patch)
treedfccab0829f6b90046b7719e3d07a0afd054429e /Source/CPack/cmCPackCygwinSourceGenerator.cxx
parent5ab6c0f0ed39136bd778a6f982691e5142a7aceb (diff)
downloadCMake-042f4c334d854448852ede2a207e7e361e53c154.zip
CMake-042f4c334d854448852ede2a207e7e361e53c154.tar.gz
CMake-042f4c334d854448852ede2a207e7e361e53c154.tar.bz2
ENH: fix crash in cpack when CPACK_CYGWIN_PATCH_NUMBER not specified
Diffstat (limited to 'Source/CPack/cmCPackCygwinSourceGenerator.cxx')
-rw-r--r--Source/CPack/cmCPackCygwinSourceGenerator.cxx18
1 files changed, 16 insertions, 2 deletions
diff --git a/Source/CPack/cmCPackCygwinSourceGenerator.cxx b/Source/CPack/cmCPackCygwinSourceGenerator.cxx
index 0856452..c8fa121 100644
--- a/Source/CPack/cmCPackCygwinSourceGenerator.cxx
+++ b/Source/CPack/cmCPackCygwinSourceGenerator.cxx
@@ -124,7 +124,14 @@ int cmCPackCygwinSourceGenerator::CompressFiles(const char* outFileName,
std::string outerTarFile
= this->GetOption("CPACK_TEMPORARY_DIRECTORY");
outerTarFile += "-";
- outerTarFile += this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
+ const char* patch = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
+ if(!patch)
+ {
+ cmCPackLogger(cmCPackLog::LOG_WARNING, "CPACK_CYGWIN_PATCH_NUMBER"
+ << " not specified, defaulting to 1\n");
+ patch = "1";
+ }
+ outerTarFile += patch;
outerTarFile += "-src.tar";
std::string buildScript = cmSystemTools::GetFilenameName(
this->GetOption("CPACK_CYGWIN_BUILD_SCRIPT"));
@@ -176,7 +183,14 @@ const char* cmCPackCygwinSourceGenerator::GetPackagingInstallPrefix()
const char* cmCPackCygwinSourceGenerator::GetOutputExtension()
{
this->OutputExtension = "-";
- this->OutputExtension += this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
+ const char* patch = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
+ if(!patch)
+ {
+ cmCPackLogger(cmCPackLog::LOG_WARNING, "CPACK_CYGWIN_PATCH_NUMBER"
+ << " not specified, defaulting to 1\n");
+ patch = "1";
+ }
+ this->OutputExtension += patch;
this->OutputExtension += "-src.tar.bz2";
return this->OutputExtension.c_str();
}