fix regression issue with log paths oops
This commit is contained in:
parent
be8041b868
commit
fca47cbce0
@ -1032,9 +1032,14 @@ namespace IW4MAdmin
|
||||
string logPath;
|
||||
string workingDirectory = basePathDirectory;
|
||||
|
||||
bool baseGameIsDirectory = !string.IsNullOrWhiteSpace(baseGameDirectory) &&
|
||||
baseGameDirectory.IndexOfAny(Utilities.DirectorySeparatorChars) != -1;
|
||||
|
||||
bool baseGameIsRelative = baseGameDirectory.FixDirectoryCharacters()
|
||||
.Equals(gameDirectory.FixDirectoryCharacters(), StringComparison.InvariantCultureIgnoreCase);
|
||||
|
||||
// we want to see if base game is provided and it 'looks' like a directory
|
||||
if (!string.IsNullOrWhiteSpace(baseGameDirectory) &&
|
||||
baseGameDirectory.IndexOfAny(Utilities.DirectorySeparatorChars) != -1)
|
||||
if (baseGameIsDirectory && !baseGameIsRelative)
|
||||
{
|
||||
workingDirectory = baseGameDirectory;
|
||||
}
|
||||
|
@ -59,5 +59,14 @@ namespace ApplicationTests
|
||||
|
||||
Assert.AreEqual(expected, generated);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_GenerateLogPath_RelativeBasePath()
|
||||
{
|
||||
string expected = "C:\\Game\\main\\folder\\log.log";
|
||||
string generated = IW4MServer.GenerateLogPath("main\\folder", "C:\\Game", "main\\folder", null, "log.log");
|
||||
|
||||
Assert.AreEqual(expected, generated);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user