changeset 22336:47629df12b79

Fix crash when choosing an inappropriate terminal in drawnow (bug #48782) * libinterp/corefcn/gl2ps-print.cc (gl2ps_renderer::draw): use a default value for terminal and warn the user, if the terminal choosen by drawnow is inappropriate.
author Kai T. Ohlhus <k.ohlhus@gmail.com>
date Thu, 18 Aug 2016 13:16:31 +0200
parents 17b71d845251
children 77c209d63b75
files libinterp/corefcn/gl2ps-print.cc
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/gl2ps-print.cc	Wed Aug 17 22:13:03 2016 -0700
+++ b/libinterp/corefcn/gl2ps-print.cc	Thu Aug 18 13:16:31 2016 +0200
@@ -172,7 +172,7 @@
 
         in_draw = true;
 
-        GLint gl2ps_term;
+        GLint gl2ps_term = GL2PS_PS;
         if (term.find ("eps") != std::string::npos)
           gl2ps_term = GL2PS_EPS;
         else if (term.find ("pdf") != std::string::npos)
@@ -186,7 +186,8 @@
         else if (term.find ("tex") != std::string::npos)
           gl2ps_term = GL2PS_TEX;
         else
-          error ("gl2ps_renderer::draw: Unknown terminal %s", term.c_str ());
+          warning ("gl2ps_renderer::draw: Unknown terminal %s, using 'ps'",
+                   term.c_str ());
 
         GLint gl2ps_text = 0;
         if (term.find ("notxt") != std::string::npos)