mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Merge pull request #14150 from michaelnebel/csharp/tracerwhitespace
C#: Explicitly quote arguments in the LUA tracer on windows.
This commit is contained in:
@@ -54,7 +54,6 @@ s = run_codeql_database_create_stdout(['dotnet clean', 'rm -rf test7-db', 'dotne
|
||||
check_build_out("hello, world", s)
|
||||
check_diagnostics(test_db="test8-db")
|
||||
|
||||
|
||||
# two arguments, no '--' (first argument quoted)
|
||||
s = run_codeql_database_create_stdout(['dotnet clean', 'rm -rf test8-db', 'dotnet run "hello world part1" part2'], "test9-db")
|
||||
check_build_out("hello world part1, part2", s)
|
||||
|
||||
@@ -64,7 +64,7 @@ function RegisterExtractorPack(id)
|
||||
|
||||
-- for `dotnet test`, we should not append `-p:UseSharedCompilation=false` to the command line
|
||||
-- if an `exe` or `dll` is passed as an argument as the call is forwarded to vstest.
|
||||
if testMatch and (arg:match('%.exe$') or arg:match('%.dll')) then
|
||||
if testMatch and (arg:match('%.exe$') or arg:match('%.dll')) then
|
||||
match = false
|
||||
break
|
||||
end
|
||||
@@ -84,10 +84,6 @@ function RegisterExtractorPack(id)
|
||||
dotnetRunNeedsSeparator = false
|
||||
dotnetRunInjectionIndex = i
|
||||
end
|
||||
-- if we encounter a whitespace, we explicitly need to quote the argument.
|
||||
if OperatingSystem == 'windows' and arg:match('%s') then
|
||||
argv[i] = '"' .. arg .. '"'
|
||||
end
|
||||
end
|
||||
if match then
|
||||
local injections = { '-p:UseSharedCompilation=false', '-p:EmitCompilerGeneratedFiles=true' }
|
||||
@@ -114,7 +110,7 @@ function RegisterExtractorPack(id)
|
||||
invocation = {
|
||||
path = AbsolutifyExtractorPath(id, compilerPath),
|
||||
arguments = {
|
||||
commandLineString = table.concat(argv, " ")
|
||||
commandLineString = ArgvToCommandLineString(argv)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -178,7 +174,7 @@ function RegisterExtractorPack(id)
|
||||
seenCompilerCall = true
|
||||
end
|
||||
if seenCompilerCall then
|
||||
table.insert(extractorArgs, '"' .. arg .. '"')
|
||||
table.insert(extractorArgs, arg)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -188,7 +184,7 @@ function RegisterExtractorPack(id)
|
||||
invocation = {
|
||||
path = AbsolutifyExtractorPath(id, extractor),
|
||||
arguments = {
|
||||
commandLineString = table.concat(extractorArgs, " ")
|
||||
commandLineString = ArgvToCommandLineString(extractorArgs)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user