Mercurial > octave
changeset 23120:b20bd0cd2f13
maint: Merge stable to default.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 30 Jan 2017 21:51:36 -0500 |
parents | 3107d3717cc2 (current diff) 46b914a213db (diff) |
children | 0fe35c34fdc2 |
files | scripts/plot/util/print.m scripts/plot/util/private/__print_parse_opts__.m |
diffstat | 2 files changed, 13 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/plot/util/print.m Mon Jan 30 17:38:12 2017 -0500 +++ b/scripts/plot/util/print.m Mon Jan 30 21:51:36 2017 -0500 @@ -314,6 +314,18 @@ opts = __print_parse_opts__ (varargin{:}); + folder = fileparts (opts.name); + if (! isempty (folder) && ! exist (folder,"dir")) + error ("print: directory %s does not exist", folder); + endif + + fid = fopen (opts.name, "w+"); + if (fid == -1) + error ("print: cannot open file %s for writing", opts.name); + endif + fclose (fid); + unlink (opts.name); + opts.pstoedit_cmd = @pstoedit; opts.fig2dev_cmd = @fig2dev; opts.latex_standalone = @latex_standalone;
--- a/scripts/plot/util/private/__print_parse_opts__.m Mon Jan 30 17:38:12 2017 -0500 +++ b/scripts/plot/util/private/__print_parse_opts__.m Mon Jan 30 21:51:36 2017 -0500 @@ -262,7 +262,7 @@ if (any (match)) default_suffix = suffixes{match}; else - default_suffix = arg_st.devopt; + error ("print: unknown device %s", arg_st.devopt); endif if (dot == 0 && ! isempty (arg_st.name))