diff --git a/src/actions/vstudio/vs200x_vcproj.lua b/src/actions/vstudio/vs200x_vcproj.lua index 3ee183e8..b01ffa39 100644 --- a/src/actions/vstudio/vs200x_vcproj.lua +++ b/src/actions/vstudio/vs200x_vcproj.lua @@ -952,9 +952,13 @@ function vc200x.links(cfg) local links = config.getlinks(cfg, "all", "fullpath") - links = table.concat(links, " ") - links = path.translate(links) - return links + for i, link in ipairs(links) do + if link:find(" ", 1, true) then + link = '"' .. link .. '"' + end + links[i] = path.translate(link) + end + return table.concat(links, " ") end diff --git a/tests/actions/vstudio/vc200x/test_linker_block.lua b/tests/actions/vstudio/vc200x/test_linker_block.lua index 691d85c9..388b741d 100644 --- a/tests/actions/vstudio/vc200x/test_linker_block.lua +++ b/tests/actions/vstudio/vc200x/test_linker_block.lua @@ -201,3 +201,20 @@ /> ]] end + + +-- +-- Libraries with spaces in the name must be wrapped in quotes. +-- + + function suite.wrapsWithQuotes_onSpaceInLibraryName() + links { "My Lib" } + prepare() + test.capture [[ +