From 44e893ab53ab463d8d110c06aa1821d645adef1f Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Fri, 23 Mar 2018 08:48:13 +0100 Subject: [PATCH] Fix issue in 'GetExtension' (#7337) `Path::GetExtension` would iterate over the full path instead of just the filename, meaning a path like `C:\My.docs\file` (note the missing extension in the filename) would return `.docs\file` as the extension. --- src/openrct2/core/Path.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/core/Path.cpp b/src/openrct2/core/Path.cpp index 895742d2c3..c4198a5559 100644 --- a/src/openrct2/core/Path.cpp +++ b/src/openrct2/core/Path.cpp @@ -162,7 +162,7 @@ namespace Path const utf8 * GetExtension(const utf8 * path) { const utf8 * lastDot = nullptr; - const utf8 * ch = path; + const utf8 * ch = GetFileName(path); for (; *ch != '\0'; ch++) { if (*ch == '.')