From e5acd354bec225e633eeb8ad08f0b397ff20e7d9 Mon Sep 17 00:00:00 2001 From: Arthur Vasseur Date: Wed, 3 Jun 2026 16:56:39 +0200 Subject: plugin/format: xmake format plugin: skip path.join when headerfile path is already absolute On Windows, path.join(projectdir, absolutePath) concatenates instead of replacing, producing oubled paths like projectdir/C:/...full/path. Source batch files happen to be relative so they were unaffected. headerfiles are absolute and triggered the bug. --- xmake/plugins/format/main.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xmake/plugins/format/main.lua b/xmake/plugins/format/main.lua index fe05d86c6..7d5e1de66 100644 --- a/xmake/plugins/format/main.lua +++ b/xmake/plugins/format/main.lua @@ -185,12 +185,12 @@ function main() for _, target in ipairs(targets) do for _, source in ipairs(target:sourcefiles()) do if _match_sourcefiles(source, filepatterns) then - table.insert(sourcefiles, path.join(projectdir, source)) + table.insert(sourcefiles, path.absolute(source, projectdir)) end end for _, header in ipairs(target:headerfiles()) do if _match_sourcefiles(header, filepatterns) then - table.insert(sourcefiles, path.join(projectdir, header)) + table.insert(sourcefiles, path.absolute(header, projectdir)) end end end @@ -199,12 +199,12 @@ function main() for _, sourcebatch in pairs(target:sourcebatches()) do if _source_batch_should_format(sourcebatch) then for _, source in ipairs(sourcebatch.sourcefiles) do - table.insert(sourcefiles, path.join(projectdir, source)) + table.insert(sourcefiles, path.absolute(source, projectdir)) end end end for _, header in ipairs(target:headerfiles()) do - table.insert(sourcefiles, path.join(projectdir, header)) + table.insert(sourcefiles, path.absolute(header, projectdir)) end end end -- cgit v1.3.1