diff libinterp/corefcn/variables.cc @ 17818:f1b59ef34eda

attempt to avoid setting persistent state on i/o streams (bug #40396) * utils.h, utils.cc (octave_preserve_stream_state): New class. * debug.cc, pr-output.cc, variables.cc, ov-base-sparse.cc: Use it to save and restore stream flags, precision, field width, and fill character.
author John W. Eaton <jwe@octave.org>
date Thu, 31 Oct 2013 17:26:04 -0400
parents 175b392e91fe
children 870f3e12e163
line wrap: on
line diff
--- a/libinterp/corefcn/variables.cc	Thu Oct 31 21:44:58 2013 +0100
+++ b/libinterp/corefcn/variables.cc	Thu Oct 31 17:26:04 2013 -0400
@@ -940,6 +940,8 @@
   std::list<whos_parameter>::iterator i = params.begin ();
   std::ostringstream param_buf;
 
+  octave_preserve_stream_state stream_state (os);
+
   while (i != params.end ())
     {
       whos_parameter param = *i;
@@ -1071,6 +1073,8 @@
 
       std::list<whos_parameter>::const_iterator i = params.begin ();
 
+      octave_preserve_stream_state stream_state (os);
+
       while (i != params.end ())
         {
           whos_parameter param = *i;