Skip to content

Commit

Permalink
replaced explicit code by fileutil_isAbsolutePath
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminBlankertz committed Feb 9, 2014
1 parent 6f74dbb commit 90bbe77
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
6 changes: 1 addition & 5 deletions fileio/file_loadMatlab.m
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,8 @@
return;
end

%% Check for absolute paths:
%% For Unix systems, absolute paths start with '\'.
%% For Windoze, identify absolute paths by the ':' (e.g., H:\some\path).
fullname= [opt.Path filesep file];

if (isunix && (file(1)==filesep)) || (ispc && (file(2)==':')),
if fileutil_isAbsolutePath(file),
if ~isdefault.Path,
warning('opt.Path is ignored, since file is given with absolute path');
end
Expand Down
5 changes: 1 addition & 4 deletions fileio/file_saveMatlab.m
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,7 @@ function file_saveMatlab(file, dat, mrk, mnt, varargin)
error('wrong format for opt.Vars');
end

%% Check for absolute paths:
%% For Unix systems, absolute paths start with '\'.
%% For Windoze, identify absolute paths by the ':' (e.g., H:\some\path).
if (isunix && (file(1)==filesep)) || (ispc && (file(2)==':')) && isdefault.Path
if if fileutil_isAbsolutePath(file),
opt.Path = '';
end

Expand Down

0 comments on commit 90bbe77

Please sign in to comment.