Skip to content

Commit

Permalink
1.6.2 (#22)
Browse files Browse the repository at this point in the history
* minimum 4 chars max 8 chars after 0x for hash in filename
  • Loading branch information
DubbleClick committed Dec 10, 2023
1 parent f9d69fc commit 1692a55
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ endif()

set(VERSION_MAJOR 1)
set(VERSION_MINOR 6)
set(VERSION_PATCH 1)
set(VERSION_PATCH 2)
set(VERSION_TWEAK 0)

set(VERSION_RC "${CMAKE_CURRENT_BINARY_DIR}/version.rc")
Expand Down
10 changes: 5 additions & 5 deletions modules/ModfileLoader.ixx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void ParseSimpleArchive(const libzippp::ZipArchive& archive, std::vector<TexEntr
//TODO: #6 - Implement regex search
auto name = entry.getName();

const static std::regex re(R"(0x[0-9a-f]{8})", std::regex::optimize | std::regex::icase);
const static std::regex re(R"(0x[0-9a-f]{4,8})", std::regex::optimize | std::regex::icase);
std::smatch match;
if (!std::regex_search(name, match, re)) {
continue;
Expand All @@ -106,11 +106,11 @@ void ParseSimpleArchive(const libzippp::ZipArchive& archive, std::vector<TexEntr
try {
crc_hash = std::stoul(match.str(), nullptr, 16);
}
catch (const std::invalid_argument& e) {
catch (const std::invalid_argument&) {
Warning("Failed to parse %s as a hash", name.c_str());
continue;
}
catch (const std::out_of_range& e) {
catch (const std::out_of_range&) {
Message("Out of range while parsing %s as a hash", name.c_str());
continue;
}
Expand Down Expand Up @@ -147,11 +147,11 @@ void ParseTexmodArchive(std::vector<std::string>& lines, libzippp::ZipArchive& a
try {
crc_hash = std::stoul(address_string, nullptr, 16);
}
catch (const std::invalid_argument& e) {
catch (const std::invalid_argument&) {
Warning("Failed to parse %s as a hash", address_string.c_str());
continue;
}
catch (const std::out_of_range& e) {
catch (const std::out_of_range&) {
Warning("Out of range while parsing %s as a hash", address_string.c_str());
continue;
}
Expand Down

0 comments on commit 1692a55

Please sign in to comment.