From c4dfbaf988d4a76803d92e0841493d4a345291d4 Mon Sep 17 00:00:00 2001 From: tomcw Date: Wed, 20 Apr 2016 22:46:12 +0100 Subject: [PATCH] -load-state: set CWD to path of .aws.yaml file --- source/Applewin.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/Applewin.cpp b/source/Applewin.cpp index 910560f3..6f630871 100644 --- a/source/Applewin.cpp +++ b/source/Applewin.cpp @@ -1090,6 +1090,14 @@ int APIENTRY WinMain(HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int) if (szSnapshotName) { + std::string strPathname(szSnapshotName); + int nIdx = strPathname.find_last_of('\\'); + if (nIdx >= 0 && nIdx+1 < (int)strPathname.length()) + { + std::string strPath = strPathname.substr(0, nIdx+1); + SetCurrentImageDir(strPath.c_str()); + } + // Override value just loaded from Registry by LoadConfiguration() // . NB. Registry value is not updated with this cmd-line value Snapshot_SetFilename(szSnapshotName);