summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/Framework/LogParsing
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-06-03 15:32:38 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-06-03 15:32:38 -0400
commit3f87210212e5ac8821ab806033f9173ed0fc0b6c (patch)
tree47644a5e778cce87094129c025c7f30e63a9a8f7 /src/SMAPI.Web/Framework/LogParsing
parent9187cda9ce7794b85f219be123c366dc2f640dc0 (diff)
downloadSMAPI-3f87210212e5ac8821ab806033f9173ed0fc0b6c.tar.gz
SMAPI-3f87210212e5ac8821ab806033f9173ed0fc0b6c.tar.bz2
SMAPI-3f87210212e5ac8821ab806033f9173ed0fc0b6c.zip
fix log parser mangling some crossplatform paths
Diffstat (limited to 'src/SMAPI.Web/Framework/LogParsing')
-rw-r--r--src/SMAPI.Web/Framework/LogParsing/LogParser.cs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/SMAPI.Web/Framework/LogParsing/LogParser.cs b/src/SMAPI.Web/Framework/LogParsing/LogParser.cs
index c50e643a..013c6c47 100644
--- a/src/SMAPI.Web/Framework/LogParsing/LogParser.cs
+++ b/src/SMAPI.Web/Framework/LogParsing/LogParser.cs
@@ -135,7 +135,10 @@ namespace StardewModdingAPI.Web.Framework.LogParsing
{
Match match = this.ModPathPattern.Match(message.Text);
log.ModPath = match.Groups["path"].Value;
- log.GamePath = new FileInfo(log.ModPath).Directory.FullName;
+ int lastDelimiterPos = log.ModPath.LastIndexOfAny(new char[] { '/', '\\' });
+ log.GamePath = lastDelimiterPos >= 0
+ ? log.ModPath.Substring(0, lastDelimiterPos)
+ : log.ModPath;
}
// log UTC timestamp line