Closed jcs090218 closed 2 years ago
It seems the bug comes from somewhere in expand-file-name
, as seen with the following example:
(expand-file-name "/Community/VC/Tools/MSVC/"
"C:/Program Files (x86)/Microsoft Visual Studio/")
;; => "c:/Community/VC/Tools/MSVC/"
This might be an Emacs bug. Tested in Emacs 28.1. However, the following works:
(f-join "C:/Program Files (x86)/Microsoft Visual Studio/"
"Community/VC/Tools/MSVC/")
;; => "c:/Program Files (x86)/Microsoft Visual Studio/Community/VC/Tools/MSVC/"
The leading /
might be what causes the bug.
As the current behavior of f-join
follows the behavior of expand-file-name
, and as changing it might lead to breaking changes, I decided to tag this issue with wontfix.
This is also the behavior of several other programing languages.
from os.path import join
print(join("C:/path/to", "/a"))
/a
#include <filesystem>
namespace fs = std::filesystem;
int main() {
fs::path p1 = "C:/path/to";
p1 /= "/a";
std::cout << p1 << '\n';
}
/a
I am trying to join two path using
f-join
function.Output
Expected Output
Any idea? 😕