Update to 14.1

This commit is contained in:
dP
2024-05-05 14:51:12 +05:00
parent 14504ff3b2
commit 46dc456049
112 changed files with 1219 additions and 958 deletions
+11 -1
View File
@@ -24,6 +24,7 @@
#include <unistd.h>
#include <pwd.h>
#endif
#include <charconv>
#include <sys/stat.h>
#include <sstream>
#include <filesystem>
@@ -570,7 +571,16 @@ bool TarScanner::AddFile(const std::string &filename, size_t, [[maybe_unused]] c
/* The size of the file, for some strange reason, this is stored as a string in octals. */
std::string size = ExtractString(th.size, lengthof(th.size));
size_t skip = size.empty() ? 0 : std::stoul(size, nullptr, 8);
size_t skip = 0;
if (!size.empty()) {
StrTrimInPlace(size);
auto [_, err] = std::from_chars(size.data(), size.data() + size.size(), skip, 8);
if (err != std::errc()) {
Debug(misc, 0, "The file '{}' has an invalid size for '{}'", filename, name);
fclose(f);
return false;
}
}
switch (th.typeflag) {
case '\0':