From 83cc7399a4f02493c475e45b472e63cd6fd5120a Mon Sep 17 00:00:00 2001 From: xicilion Date: Tue, 25 Jun 2019 00:04:50 +0800 Subject: [PATCH] path, bugfix: result error in path.resolve root test case. --- fibjs/include/path.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fibjs/include/path.h b/fibjs/include/path.h index f9c8b1458d..1d15edc476 100644 --- a/fibjs/include/path.h +++ b/fibjs/include/path.h @@ -565,7 +565,14 @@ inline result_t _resolve(OptArgs ps, exlib::string& retVal) p.resolvePosix(s); } - return _normalize(p.str(), retVal, true); + result_t hr = _normalize(p.str(), retVal, true); + if (hr < 0) + return hr; + + if (retVal.empty()) + retVal = "/"; + + return 0; } inline result_t _resolve(exlib::string& path)