From 7d71b5ebd84772baa08dc4151c07a94d4abc0526 Mon Sep 17 00:00:00 2001 From: "METANEOCORTEX\\Kotti" Date: Thu, 2 Dec 2021 00:04:23 +0100 Subject: [PATCH] +fix: parsing file arg: relative from working dir --- src/PathLib.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/PathLib.c b/src/PathLib.c index 437f38e70..76adaa196 100644 --- a/src/PathLib.c +++ b/src/PathLib.c @@ -1743,7 +1743,10 @@ size_t PTHAPI Path_NormalizeEx(HPATHL hpth_in_out, const HPATHL hpth_wrkdir, boo HPATHL hsrch_pth = Path_Allocate(PathGet(hpth_wrkdir)); Path_Append(hsrch_pth, Path_Get(hpth_in_out)); if (bSearchPathIfRelative) { - if (!Path_IsExistingFile(hsrch_pth)) { + if (Path_IsExistingFile(hsrch_pth)) { + Path_Swap(hpth_in_out, hsrch_pth); + } + else { Path_StripPath(hsrch_pth); HSTRINGW hsrch_str = StrgCreate(NULL); LPWSTR const buf = StrgWriteAccessBuf(hsrch_str, PATHLONG_MAX_CCH);