From a83daf8700119c57dc7c7beb2ef825e9e3aacdde Mon Sep 17 00:00:00 2001 From: JailDoctor Date: Mon, 23 Oct 2023 16:00:24 +0200 Subject: [PATCH] - [FIX] En Windows ficava backslashes i tot petaba --- respak2.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/respak2.cpp b/respak2.cpp index cc3c2fc..ffd5823 100644 --- a/respak2.cpp +++ b/respak2.cpp @@ -3,6 +3,7 @@ #include #include #include +#include using namespace std; namespace fs = std::filesystem; @@ -103,7 +104,11 @@ void doPack() fo.write( (char*)&file.size, 4 ); const uint8_t path_size = file.path.size(); fo.write( (char*)&path_size, 1 ); - fo.write( file.path.c_str(), path_size ); + // We use this preliminar step to replace '\' with '/', as respak2 in windows generates backslashes, which break everything + char replace[256]; + strcpy(replace, file.path.c_str()); + for (int i=0; i