From b7702826f435c61243f70e4fa8b2f9c6e80e8b63 Mon Sep 17 00:00:00 2001 From: O B Date: Sun, 30 Apr 2023 20:37:09 -0700 Subject: [PATCH] fixed path issue --- .vscode/launch.json | 3 ++- src/ProgramArgs.cpp | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 397a836..66f1d4d 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -14,7 +14,8 @@ // "args": ["123123DropBox.exe", "-sleepTime", "1200"], // "args": ["123123DropBox.exe", "-sleepTime", "a1200"], // "args": ["123123DropBox.exe", "-sleepTime"], - "args": ["-exesConfig"], + // "args": ["-exesConfig"], + "args": ["-ec"], "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [], diff --git a/src/ProgramArgs.cpp b/src/ProgramArgs.cpp index 6d1186b..2b85a7c 100644 --- a/src/ProgramArgs.cpp +++ b/src/ProgramArgs.cpp @@ -2,6 +2,7 @@ #include #include +#include #include #include "Common.h" @@ -68,8 +69,9 @@ bool ProcessProgramArgs(int argc , const char** argv, ProgramCmdLineOptions& pro cmdArgs.pop_back(); if(hasExeConfigs) - { - std::ifstream file("exesConfig.ecfg"); + { + const std::string exeConfPath = std::filesystem::current_path().string() + "\\" + "exesConfig.ecfg"; + std::ifstream file(exeConfPath); if (file.is_open()) { std::string line; @@ -84,7 +86,7 @@ bool ProcessProgramArgs(int argc , const char** argv, ProgramCmdLineOptions& pro } else { - PrintToConsole( "exesConfigs.ecfg not found\n" ); + PrintToConsole( "exesConfig.ecfg not found\n" ); return false; } }