Fix handling of non-ASCII characters when resizing file
This commit is contained in:
parent
3da25a39a4
commit
9f134725c7
|
@ -46,7 +46,7 @@ endif ()
|
||||||
set(CONFIGURATION_PACKAGE_SUFFIX
|
set(CONFIGURATION_PACKAGE_SUFFIX
|
||||||
""
|
""
|
||||||
CACHE STRING "sets the suffix for find_package() calls to packages configured via c++utilities")
|
CACHE STRING "sets the suffix for find_package() calls to packages configured via c++utilities")
|
||||||
find_package(c++utilities${CONFIGURATION_PACKAGE_SUFFIX} 5.0.0 REQUIRED)
|
find_package(c++utilities${CONFIGURATION_PACKAGE_SUFFIX} 5.14.0 REQUIRED)
|
||||||
use_cpp_utilities(VISIBILITY PUBLIC)
|
use_cpp_utilities(VISIBILITY PUBLIC)
|
||||||
|
|
||||||
# find 3rd party libraries
|
# find 3rd party libraries
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
#include <c++utilities/conversion/stringbuilder.h>
|
#include <c++utilities/conversion/stringbuilder.h>
|
||||||
#include <c++utilities/conversion/stringconversion.h>
|
#include <c++utilities/conversion/stringconversion.h>
|
||||||
|
#include <c++utilities/io/path.h>
|
||||||
|
|
||||||
#include <openssl/conf.h>
|
#include <openssl/conf.h>
|
||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
|
@ -430,7 +431,7 @@ void PasswordFile::save(PasswordFileSaveFlags options)
|
||||||
const auto newSize = static_cast<std::size_t>(m_file.tellp());
|
const auto newSize = static_cast<std::size_t>(m_file.tellp());
|
||||||
if (fileSize && newSize < fileSize) {
|
if (fileSize && newSize < fileSize) {
|
||||||
m_file.close();
|
m_file.close();
|
||||||
std::filesystem::resize_file(m_path, newSize);
|
std::filesystem::resize_file(makeNativePath(m_path), newSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue