changeset 11756:d68fc0ca4ece release-3-0-x

disp: produce sq-string unless arg is a dq-string
author John W. Eaton <jwe@octave.org>
date Fri, 18 Apr 2008 12:01:53 -0400
parents ccab9d3d1d21
children 61f955d848c3
files src/ChangeLog src/pr-output.cc
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2008-04-18  John W. Eaton  <jwe@octave.org>
+
+	* pr-output.cc (Fdisp): If nargout > 0, produce an sq-string
+	unless arg is a dq-string.
+
 2008-04-14  Jaroslav Hajek <highegg@gmail.com>
 
 	* oct-stream.cc (octave_scan_1): Ensure digit following X is hex
--- a/src/pr-output.cc
+++ b/src/pr-output.cc
@@ -2809,9 +2809,10 @@
 	args(0).print (octave_stdout);
       else
 	{
+	  octave_value arg = args(0);
 	  std::ostringstream buf;
-	  args(0).print (buf);
-	  retval = buf.str ();
+	  arg.print (buf);
+	  retval = octave_value (buf.str (), arg.is_dq_string () ? '"' : '\'');
 	}
     }
   else