diff options
author | Brad King <brad.king@kitware.com> | 2021-08-20 15:23:20 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-08-20 15:23:20 (GMT) |
commit | 20fec1520458cdfb71bf1099cfc3648154d57d8f (patch) | |
tree | 2597bc6fb97dfbe86cdc41bd8efa7b0c97d2aebf /Source/cmArchiveWrite.cxx | |
parent | e2c06736e54d9160e49d5a67f5c10ca601ab31ed (diff) | |
download | CMake-20fec1520458cdfb71bf1099cfc3648154d57d8f.zip CMake-20fec1520458cdfb71bf1099cfc3648154d57d8f.tar.gz CMake-20fec1520458cdfb71bf1099cfc3648154d57d8f.tar.bz2 |
cmArchiveWrite: Check for construction errors on Open
Also update call sites to report the error.
Issue: #19666
Diffstat (limited to 'Source/cmArchiveWrite.cxx')
-rw-r--r-- | Source/cmArchiveWrite.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index 54b2998..9e0d80c 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -250,6 +250,9 @@ cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c, bool cmArchiveWrite::Open() { + if (!this->Error.empty()) { + return false; + } if (archive_write_open( this->Archive, this, nullptr, reinterpret_cast<archive_write_callback*>(&Callback::Write), |