From 6f7e45ba9f6d25079d48f1f14564b1a0b8803c85 Mon Sep 17 00:00:00 2001 From: ruevs Date: Wed, 15 Nov 2023 23:22:10 +0200 Subject: [PATCH] Fix invalid parts linkage in assemblies when the folder has only one char. Fix a bug in the `Split` function that would drop a single character directory name at the end of the path. Because of the above bug when a directory containing an assembly file had a name with only one character, the assembly file was saved incorrectly and the path to the linked files was invalid. For example if `assembly.slvs` was located in a directory called `a` and links `subpart.slvs` in the same directory this would result in: Group.impFileRel=a\subpart.slvs Which resulted in the linked part not being found when opening next time. Fixes: #1347 --- src/platform/platform.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/platform/platform.cpp b/src/platform/platform.cpp index b7bf83a..c2cb542 100644 --- a/src/platform/platform.cpp +++ b/src/platform/platform.cpp @@ -93,9 +93,7 @@ static std::vector Split(const std::string &joined, char separator) pos += 1; } - if(oldpos != joined.length() - 1) { - parts.push_back(joined.substr(oldpos)); - } + parts.push_back(joined.substr(oldpos)); return parts; }