diff --git a/Utils/Shared/filesepStandard.m b/Utils/Shared/filesepStandard.m index 78027340..e099c99e 100644 --- a/Utils/Shared/filesepStandard.m +++ b/Utils/Shared/filesepStandard.m @@ -49,7 +49,9 @@ idxs = []; k = find(pathname0=='\' | pathname0=='/'); for ii = 1:length(k) - if (ii>1) && (k(ii) == k(ii-1)+1) + if (ii>1) && (k(ii) == k(ii-1)+1) && (k(ii) > 2) + % adjacent two values are same, and the values are not the + % first two characters (for paths like \\ad\eng\ ...) idxs = [idxs, k(ii)]; %#ok continue; end diff --git a/Utils/submodules/filesepStandard_startup.m b/Utils/submodules/filesepStandard_startup.m index c018b959..9c7e4555 100644 --- a/Utils/submodules/filesepStandard_startup.m +++ b/Utils/submodules/filesepStandard_startup.m @@ -50,9 +50,10 @@ idxs = []; k = find(pathname0=='\' | pathname0=='/'); for ii = 1:length(k) - if (ii>1) && (k(ii) == k(ii-1)+1) + if (ii>1) && (k(ii) == k(ii-1)+1) && (k(ii) > 2) + % adjacent two values are same, and the values are not the + % first two characters (for paths like \\ad\eng\ ...) idxs = [idxs, k(ii)]; %#ok - continue; end pathname0(k(ii)) = '/'; end diff --git a/setpaths.m b/setpaths.m index 4cff9aae..f832b9ce 100644 --- a/setpaths.m +++ b/setpaths.m @@ -577,9 +577,10 @@ function printMethod(msg) idxs = []; k = find(pathname0=='\' | pathname0=='/'); for ii = 1:length(k) - if (ii>1) && (k(ii) == k(ii-1)+1) + if (ii>1) && (k(ii) == k(ii-1)+1) && (k(ii) > 2) + % adjacent two values are same, and the values are not the + % first two characters (for paths like \\ad\eng\ ...) idxs = [idxs, k(ii)]; %#ok - continue; end pathname0(k(ii)) = '/'; end