Mercurial > hg > octave-lojdl
changeset 14170:2ff75e38c299 stable
improve error message in __gnuplot_print__
* __gnuplot_print__: Provide more meaningful error message if file name
suffix is not recognized for pslatex terminal.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sun, 08 Jan 2012 16:28:31 -0500 |
parents | c0ca47ab7641 |
children | 2ced2f59f523 |
files | scripts/plot/private/__gnuplot_print__.m |
diffstat | 1 files changed, 7 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/plot/private/__gnuplot_print__.m +++ b/scripts/plot/private/__gnuplot_print__.m @@ -69,10 +69,13 @@ endif case {"epslatex", "pslatex", "pstex", "epslatexstandalone"} dot = find (opts.name == ".", 1, "last"); - if ((! isempty (dot)) - && any (strcmpi (opts.name(dot:end), - {".eps", ".ps", ".pdf", ".tex", "."}))) - name = opts.name(1:dot-1); + if (! isempty (dot)) + if (any (strcmpi (opts.name(dot:end), {".eps", ".ps", ".pdf", ".tex", "."}))) + name = opts.name(1:dot-1); + else + error ("print:invalid-suffix", "unrecognized file name suffix `%s' for %s output type", + opts.name(dot:end), lower (opts.devopt)); + endif endif if (strfind (opts.devopt, "standalone")) term = sprintf ("%s ",