aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorNagy-Egri Máté Ferenc <beiktatas+github@outlook.hu>2024-10-30 08:51:11 +0100
committerGitHub <noreply@github.com>2024-10-30 00:51:11 -0700
commit362273d1435c0cc104418f88b0140d0388e9ee22 (patch)
treed54523cd9e5c815486dbff23cd5fe3cfccd84fac /clang/lib/CodeGen/CodeGenModule.cpp
parentdc56a86b96d77a93f761995d50f7b2f112856311 (diff)
downloadllvm-362273d1435c0cc104418f88b0140d0388e9ee22.zip
llvm-362273d1435c0cc104418f88b0140d0388e9ee22.tar.gz
llvm-362273d1435c0cc104418f88b0140d0388e9ee22.tar.bz2
[clang-format] Fix path expansion inside git-clang-format.bat (#114078)
The trampoline script used on Windows (due to the absence of shebang support) doesn't properly expand the path to the Python script, as it leaves out the drive letter. Functionally equivalent reproducer in action ``` PS C:\Users\mate> gc (gcm git-clang-formatish.bat).Source @ECHO OFF echo "%~pn0" %* PS C:\Users\mate> git-clang-formatish "\Users\mate\git-clang-formatish" ``` Adding `d` to the variable modifiers [as per the docs](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/for) the drive letter is added. Even in the magical cases when it works. (I couldn't reproduce, but I suspect it's only tested from some bash/cygwin variant, where the path becomes `/c/Program Files/...`, but the drive letter is needed. Without it, I also observed cases when used via `git clang-format` (without the inital dash) it tries to infer the drive letter based on the current working directory. In that case it fails to find `D:\Program Files\LLVM\bin\clang-format.exe`, which naturally fails, because `Program Files` is on `C:`)
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions