From 35a5086528a2013006a243d1233c1a42d6aaa1dd Mon Sep 17 00:00:00 2001 From: Andreas Husch <27815260+adhusch@users.noreply.github.com> Date: Thu, 3 Aug 2017 17:05:18 +0200 Subject: [PATCH] Fix usage with full-filename including path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make call like fig2pdf3d(gca, ‘/foo/bar/filename’) work too (crashed before) --- idtf2u3d/idtf2u3d.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/idtf2u3d/idtf2u3d.m b/idtf2u3d/idtf2u3d.m index ec03faa..b3813ac 100644 --- a/idtf2u3d/idtf2u3d.m +++ b/idtf2u3d/idtf2u3d.m @@ -114,4 +114,6 @@ function [fname] = full_fname_with_extension(fname, extension) fname = check_file_extension(fname, extension); -fname = fullfile(cd, fname); +if(isempty(fileparts(fname))) + fname = fullfile(cd, fname); +end