From 9e31ef9c043658d4688c5998e0e0bd13ba407cef Mon Sep 17 00:00:00 2001 From: Mauco03 <marco.gaibotti@skywarder.eu> Date: Thu, 16 May 2024 19:09:43 +0200 Subject: [PATCH] [refactoring-ode][Mission] Fixed a bug where paths would not be trimmed correctly --- classes/Mission.m | 2 +- functions/miscellaneous/trimPath.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/Mission.m b/classes/Mission.m index 2694c76..f505cd8 100644 --- a/classes/Mission.m +++ b/classes/Mission.m @@ -65,7 +65,7 @@ classdef Mission < Config obj.configPath = fullfile(obj.currentPath, obj.name, 'config'); obj.dataPath = fullfile(obj.currentPath, obj.name, 'data'); obj.msaPath = trimPath( ... - fullfile(obj.currentPath, '..', '..', 'msa-toolkit') ... + fullfile(obj.currentPath, '..', '..', '..', 'msa-toolkit') ... ); end diff --git a/functions/miscellaneous/trimPath.m b/functions/miscellaneous/trimPath.m index 192009c..1fe4dd6 100644 --- a/functions/miscellaneous/trimPath.m +++ b/functions/miscellaneous/trimPath.m @@ -13,7 +13,7 @@ out = fullfile(path); % Trims multiple separators characters exp = ['\', filesep, '[^\', filesep,']+\', filesep,'\.\.']; while ~trimmed - out = regexprep(out, exp, ''); + out = regexprep(out, exp, '', 'once'); trimmed = ~logical(regexp(out, exp, 'once')); end -- GitLab