Skip to content

Commit 61bd9f2

Browse files
committed
C#: Address review comments
1 parent 4f897b2 commit 61bd9f2

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

csharp/extractor/Semmle.Extraction.CSharp/Analyser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ public bool LogRoslynArgs(string[] roslynArgs, string extractorVersion)
456456
bool argsWritten;
457457
using (var streamWriter = new StreamWriter(new FileStream(tempFile, FileMode.Append, FileAccess.Write)))
458458
{
459-
streamWriter.WriteLine($"# Arguments to Roslyn: {string.Join(' ', roslynArgs)}");
459+
streamWriter.WriteLine($"# Arguments to Roslyn: {string.Join(' ', roslynArgs.Where(arg => !arg.StartsWith('@')))}");
460460
argsWritten = roslynArgs.WriteCommandLine(streamWriter);
461461
}
462462

csharp/extractor/Semmle.Util/CommandLineExtensions.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@ public static class CommandLineExtensions
1515
/// <returns>True iff the file was written.</returns>
1616
public static bool WriteCommandLine(this IEnumerable<string> commandLineArguments, TextWriter textWriter)
1717
{
18-
foreach (var arg in commandLineArguments.Where(arg => arg[0] == '@').Select(arg => arg.Substring(1)))
18+
var found = false;
19+
foreach (var arg in commandLineArguments.Where(arg => arg.StartsWith('@')).Select(arg => arg.Substring(1)))
1920
{
2021
string line;
2122
using (StreamReader file = new StreamReader(arg))
2223
while ((line = file.ReadLine()) != null)
2324
textWriter.WriteLine(line);
24-
return true;
25+
found = true;
2526
}
26-
return false;
27+
return found;
2728
}
2829
}
2930
}

0 commit comments

Comments
 (0)