summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:13:13 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:13:13 +0900
commit0375131677cc32a24352f205d05c730690c55af6 (patch)
tree749fa75697d8f28962e338b35cf7c099f4099957 /Source
parentba608e51abaeeca867d14590749beda6c283e3a8 (diff)
downloadcmake-upstream/3.10.3.tar.gz
cmake-upstream/3.10.3.tar.bz2
cmake-upstream/3.10.3.zip
Imported Upstream version 3.10.3upstream/3.10.3
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CursesDialog/cmCursesMainForm.cxx2
-rw-r--r--Source/cmQtAutoGenerators.cxx20
3 files changed, 15 insertions, 9 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index c262bddee..9367e480f 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 10)
-set(CMake_VERSION_PATCH 2)
+set(CMake_VERSION_PATCH 3)
#set(CMake_VERSION_RC 0)
diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx
index dbd024da6..4a9dc473c 100644
--- a/Source/CursesDialog/cmCursesMainForm.cxx
+++ b/Source/CursesDialog/cmCursesMainForm.cxx
@@ -475,7 +475,7 @@ void cmCursesMainForm::UpdateStatusBar(const char* message)
strncpy(bar + curFieldLen + 2, help, width - curFieldLen - 2);
if (curFieldLen + helpLen + 2 < width) {
memset(bar + curFieldLen + helpLen + 2, ' ',
- width - curFieldLen + helpLen + 2);
+ width - (curFieldLen + helpLen + 2));
}
}
}
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index a9c9b9d36..f91ebb23e 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -80,15 +80,21 @@ static bool ReadFile(std::string& content, std::string const& filename,
std::size_t const length = cmSystemTools::FileLength(filename);
cmsys::ifstream ifs(filename.c_str(), (std::ios::in | std::ios::binary));
if (ifs) {
- content.resize(length);
- ifs.read(&content.front(), content.size());
- if (ifs) {
- success = true;
+ if (length > 0) {
+ content.resize(length);
+ ifs.read(&content.front(), content.size());
+ if (ifs) {
+ success = true;
+ } else {
+ content.clear();
+ if (error != nullptr) {
+ error->append("Reading from the file failed.");
+ }
+ }
} else {
+ // Readable but empty file
content.clear();
- if (error != nullptr) {
- error->append("Reading from the file failed.");
- }
+ success = true;
}
} else if (error != nullptr) {
error->append("Opening the file for reading failed.");