Skip to content

Commit a06ae01

Browse files
committed
Fix
1 parent f7a2c4a commit a06ae01

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/Grpc/Interop/test/InteropTests/Helpers/ProcessDebugHelper.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using System.Diagnostics;
@@ -10,20 +10,23 @@ public static class ProcessDebugHelper
1010
public static string GetDebugCommand(ProcessStartInfo psi)
1111
{
1212
// Quote the file name if it contains spaces or special characters
13-
string fileName = QuoteIfNeeded(psi.FileName);
13+
var fileName = QuoteIfNeeded(psi.FileName);
1414

1515
// Arguments are typically already passed as a single string
16-
string arguments = psi.Arguments;
16+
var arguments = psi.Arguments;
1717

1818
return $"{fileName} {arguments}".Trim();
1919
}
2020

2121
private static string QuoteIfNeeded(string value)
2222
{
23-
if (string.IsNullOrWhiteSpace(value)) return "\"\"";
23+
if (string.IsNullOrWhiteSpace(value))
24+
{
25+
return "\"\"";
26+
}
2427

2528
// Add quotes if value contains spaces or special characters
26-
if (value.Contains(" ") || value.Contains("\""))
29+
if (value.Contains(' ') || value.Contains('"'))
2730
{
2831
return $"\"{value.Replace("\"", "\\\"")}\"";
2932
}

0 commit comments

Comments
 (0)