Skip to content

Commit

Permalink
make filesepStandard_startup compatible with \\
Browse files Browse the repository at this point in the history
some directories (like university server ones) use double backslash or forward slash at the beginning. Add exception to removing double+ slashes at the very beginning.
  • Loading branch information
kk1995 committed May 21, 2024
1 parent ca8145b commit b693455
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Utils/submodules/filesepStandard_startup.m
Original file line number Diff line number Diff line change
Expand Up @@ -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<AGROW>
continue;
end
pathname0(k(ii)) = '/';
end
Expand Down
5 changes: 3 additions & 2 deletions setpaths.m
Original file line number Diff line number Diff line change
Expand Up @@ -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<AGROW>
continue;
end
pathname0(k(ii)) = '/';
end
Expand Down

0 comments on commit b693455

Please sign in to comment.