function [newfilename]=makepathabs(filename);
%function [newfilename]=makepathabs(filename);
%
% Puts absolute path in front of the filename

% ---------------------------------
% Copyright (c) 2002 Serge Dumoulin
% This program is free software; you can redistribute it and/or
% modify it under the terms of the GNU General Public License version 2
% as published by the Free Software Foundation.
% ---------------------------------


% does not handle relative paths very elegantly

[path,file]=getbase(deblank(filename));

div=filesep;

if isempty(path),
   newfilename=[pwd div file];
else,
   if path(1)=='.',      % relative path
      newfilename=[pwd div path file];
   else,
      newfilename=[path file];
   end;
end;