summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/release-notes.md1
-rw-r--r--src/SMAPI.Web/Framework/LogParsing/LogParser.cs5
2 files changed, 5 insertions, 1 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md
index 210f4496..39b431cf 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -54,6 +54,7 @@
* Redesigned upload page to make it more intuitive for new players.
* Changed filters to show `DEBUG` messages by default.
* Fixed issue parsing content packs with no description.
+ * Fixed mangled crossplatform paths in some cases.
* For SMAPI developers:
* Added more consistent crossplatform handling using a new `EnvironmentUtility`, including MacOS detection.
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