From d11ee2a4cf83bbe65c7bf9d8c82165ce913bf654 Mon Sep 17 00:00:00 2001 From: jomjol <30766535+jomjol@users.noreply.github.com> Date: Sun, 25 Sep 2022 19:39:10 +0200 Subject: [PATCH] Rolling 20220925 --- .gitignore | 1 + code/components/jomjol_fileserver_ota/server_file.cpp | 4 ++++ code/components/jomjol_helper/Helper.cpp | 3 +++ 3 files changed, 8 insertions(+) diff --git a/.gitignore b/.gitignore index facb4887..089c9ea4 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ .code-workspace /sd-card/htm./.vscode/ /code/build +/code/.helper /sd-card/html/debug/ /firmware/ version.txt diff --git a/code/components/jomjol_fileserver_ota/server_file.cpp b/code/components/jomjol_fileserver_ota/server_file.cpp index 0d49436c..07487c73 100644 --- a/code/components/jomjol_fileserver_ota/server_file.cpp +++ b/code/components/jomjol_fileserver_ota/server_file.cpp @@ -719,12 +719,14 @@ std::string unzip_new(std::string _in_zip_file, std::string _target_zip, std::st void* p; char archive_filename[64]; std::string zw, ret = ""; + std::string directory = ""; // static const char* s_Test_archive_filename = "testhtml.zip"; printf("miniz.c version: %s\n", MZ_VERSION); printf("Zipfile: %s\n", _in_zip_file.c_str()); printf("Target Dir ZIP: %s\n", _target_zip.c_str()); printf("Target Dir BIN: %s\n", _target_bin.c_str()); + printf("Target Dir main: %s\n", _main.c_str()); // Now try to open the archive. memset(&zip_archive, 0, sizeof(zip_archive)); @@ -765,6 +767,8 @@ std::string unzip_new(std::string _in_zip_file, std::string _target_zip, std::st // Save to File. zw = std::string(archive_filename); + printf("Rohfilename: %s\n", zw.c_str()); + if (toUpper(zw) == "FIRMWARE.BIN") { zw = _target_bin + zw; diff --git a/code/components/jomjol_helper/Helper.cpp b/code/components/jomjol_helper/Helper.cpp index eb9ab4f5..2d543735 100644 --- a/code/components/jomjol_helper/Helper.cpp +++ b/code/components/jomjol_helper/Helper.cpp @@ -305,6 +305,9 @@ string getDirectory(string filename) { size_t lastpos = filename.find('/'); + if (lastpos == string::npos) + lastpos = filename.find('\\'); + if (lastpos == string::npos) return "";