From ab25935685f15d21021606a18cd6f9fff220efed Mon Sep 17 00:00:00 2001 From: JIe Date: Thu, 7 Nov 2024 18:53:34 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=BD=93=E5=89=8D=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E7=9B=AE=E5=BD=95=E4=B8=BA=E6=A8=A1=E5=9D=97=E6=89=80?= =?UTF-8?q?=E5=9C=A8=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.cc b/src/main.cc index 3d5f585..3108c6b 100644 --- a/src/main.cc +++ b/src/main.cc @@ -63,6 +63,11 @@ int main(int argc, char **) { std::string filterComName; std::string inputCommands; std::stringstream oss; + char path_buffer[MAX_PATH + 1]; + GetModuleFileName(nullptr, path_buffer, MAX_PATH); + (strrchr(path_buffer, '\\'))[0] = 0; + std::string path = path_buffer; + filesystem::current_path(path); if (filesystem::exists("./config.toml")) { const auto config = toml::parse("./config.toml"); filterComName = config.at("ComPorts").as_string();