Skip to content

Commit 5746cba

Browse files
committed
Fixing parser issues with space within response file path.
1 parent d34de5d commit 5746cba

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

FASTBuild.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,17 @@ private Dictionary<string, string> ParseCommandLineOptions(string CompilerComman
161161
string PartialToken = "";
162162
string ResponseFilePath = "";
163163

164-
if (RawTokens.Length == 1 && RawTokens[0].StartsWith("@\"")) //Response files are in 4.13 by default. Changing VCToolChain to not do this is probably better.
164+
if (RawTokens.Length >= 1 && RawTokens[0].StartsWith("@\"")) //Response files are in 4.13 by default. Changing VCToolChain to not do this is probably better.
165165
{
166-
ResponseFilePath = RawTokens[0].Substring(2, RawTokens[0].Length - 3); // bit of a bodge to get the @"response.txt" path...
166+
string responseCommandline = RawTokens[0];
167+
168+
// If we had spaces inside the response file path, we need to reconstruct the path.
169+
for(int i = 1; i < RawTokens.Length; ++i)
170+
{
171+
responseCommandline += " " + RawTokens[i];
172+
}
173+
174+
ResponseFilePath = responseCommandline.Substring(2, responseCommandline.Length - 3); // bit of a bodge to get the @"response.txt" path...
167175
try
168176
{
169177
string[] Separators = { "\n", " ", "\r" };
@@ -915,7 +923,7 @@ private bool ExecuteBffFile(string BffFilePath)
915923
string distArgument = bEnableDistribution ? "-dist" : "";
916924

917925
//Interesting flags for FASTBuild: -nostoponerror, -verbose, -monitor (if FASTBuild Monitor Visual Studio Extension is installed!)
918-
string FBCommandLine = string.Format("-summary {0} {1} -ide -config {2}", distArgument, cacheArgument, BffFilePath);
926+
string FBCommandLine = string.Format("-monitor -summary {0} {1} -ide -config {2}", distArgument, cacheArgument, BffFilePath);
919927

920928
ProcessStartInfo FBStartInfo = new ProcessStartInfo(string.IsNullOrEmpty(FBuildExePathOverride) ? "fbuild" : FBuildExePathOverride, FBCommandLine);
921929

0 commit comments

Comments
 (0)