Fix: VS 2019 16.6 doesn't like newlines in <SettingsCommandLine>

This commit is contained in:
glx
2020-05-26 21:38:07 +02:00
committed by glx22
parent 800ade7702
commit 2b2f60caf5
8 changed files with 20 additions and 24 deletions

View File

@@ -321,21 +321,26 @@ Sub load_baseset_data(dir, langdir, ByRef vcxproj, ByRef files, ByRef langs)
End Sub
Sub generate(data, dest, data2)
Dim srcfile, destfile, line
Dim srcfile, destfile, line, regexp
WScript.Echo "Generating " & FSO.GetFileName(dest) & "..."
Set srcfile = FSO.OpenTextFile(dest & ".in", 1, 0, 0)
Set destfile = FSO.CreateTextFile(dest, -1, 0)
If Not IsNull(data2) Then
' Everything above the !!FILTERS!! marker
Set regexp = New RegExp
regexp.Pattern = "!!FILTERS!!"
regexp.Global = True
line = srcfile.ReadLine()
While line <> "!!FILTERS!!"
While Not regexp.Test(line)
If len(line) > 0 Then destfile.WriteLine(line)
line = srcfile.ReadLine()
Wend
' Our generated content
destfile.WriteLine(data2)
line = regexp.Replace(line, data2)
destfile.WriteLine(line)
End If
' Everything above the !!FILES!! marker