summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI.Web')
-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