Skip to content

Commit edf6a80

Browse files
author
Dave Bartolomeo
authored
Merge pull request github#14185 from michaelnebel/csharp/quotinghotfixrc
C#: Quoting hotfix.
2 parents d792175 + 7bcaa49 commit edf6a80

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

csharp/ql/integration-tests/all-platforms/dotnet_run/test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,9 @@ def check_build_out(msg, s):
5353
s = run_codeql_database_create_stdout(['dotnet clean', 'rm -rf test7-db', 'dotnet build', 'dotnet run --no-build hello world'], "test8-db")
5454
check_build_out("hello, world", s)
5555
check_diagnostics(test_db="test8-db")
56+
57+
58+
# two arguments, no '--' (first argument quoted)
59+
s = run_codeql_database_create_stdout(['dotnet clean', 'rm -rf test8-db', 'dotnet run "hello world part1" part2'], "test9-db")
60+
check_build_out("hello world part1, part2", s)
61+
check_diagnostics(test_db="test9-db")

csharp/tools/tracing-config.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ function RegisterExtractorPack(id)
8484
dotnetRunNeedsSeparator = false
8585
dotnetRunInjectionIndex = i
8686
end
87+
-- if we encounter a whitespace, we explicitly need to quote the argument.
88+
if OperatingSystem == 'windows' and arg:match('%s') then
89+
argv[i] = '"' .. arg .. '"'
90+
end
8791
end
8892
if match then
8993
local injections = { '-p:UseSharedCompilation=false', '-p:EmitCompilerGeneratedFiles=true' }

0 commit comments

Comments
 (0)