From 7bd3bf6e396367e7d3c7561ea7736c0c58c996cd Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Tue, 12 Sep 2023 19:42:15 -0230 Subject: [PATCH] Fix ROM audit in Windows (fixes #988). --- src/os/windows/FSNodeWINDOWS.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/os/windows/FSNodeWINDOWS.cxx b/src/os/windows/FSNodeWINDOWS.cxx index cf6d2a666..b782a05a9 100644 --- a/src/os/windows/FSNodeWINDOWS.cxx +++ b/src/os/windows/FSNodeWINDOWS.cxx @@ -206,7 +206,13 @@ bool FSNodeWINDOWS::makeDir() bool FSNodeWINDOWS::rename(string_view newfile) { if (!_isPseudoRoot && MoveFile(_path.c_str(), string{newfile}.c_str()) != 0) + { + _path = newfile; + if (_path[0] == '~') + _path.replace(0, 1, HomeFinder::getHomePath()); + return setFlags(); + } return false; }