changeset 3215:bc3fdfe311a3

[project @ 1998-11-10 14:06:21 by jwe]
author jwe
date Tue, 10 Nov 1998 14:12:07 +0000
parents 8cc04ca5b4ca
children 60a89a69a70a
files ChangeLog Makeconf.in acconfig.h configure.in liboctave/ChangeLog liboctave/byte-swap.h liboctave/cmd-edit.cc liboctave/cmd-edit.h octave-bug.in scripts/ChangeLog scripts/configure.in scripts/strings/deblank.m src/ChangeLog src/data.cc src/input.cc src/pr-output.cc src/pr-output.h src/pt-assign.cc src/pt-idx.cc src/pt-idx.h src/pt-loop.cc src/toplev.cc
diffstat 22 files changed, 317 insertions(+), 96 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
+Mon Nov  9 08:53:03 1998  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* Makeconf.in (LIBGLOB): Add a place for substitution to occur.
+	(GLOB_INCFLAGS): Define as @GLOB_INCFLAGS@, not @DLFCN_INCFLAGS@.
+	(do-subst-config-vals): Don't forget LIBGLOB.
+	* octave-bug.in (LIBGLOB): Substitute here too, and add it to the
+	list of configuration items to print.
+
 Mon Nov  2 20:33:16 1998  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
+	* configure.in: Define __NO_MATH_INLINES.
+	* acconfig.h: Add #undef for it.
+
+	* configure.in (AC_OUTPUT): Escape newlinew in macro call with \.
+
 	* install-octave.in (SHLEXT): Substitute.
 	(SHLEXT_VER): Define.
 	Use them for installing shared libraries.
--- a/Makeconf.in
+++ b/Makeconf.in
@@ -73,7 +73,7 @@
 # cc and associated flags.
 
 DLFCN_INCFLAGS = @DLFCN_INCFLAGS@
-GLOB_INCFLAGS = @DLFCN_INCFLAGS@
+GLOB_INCFLAGS = @GLOB_INCFLAGS@
 
 # Clean up INCFLAGS a bit if we are not compiling in a separate
 # directory.
@@ -135,6 +135,7 @@
 
 TERMLIBS = @TERMLIBS@
 LIBDLFCN = @LIBDLFCN@
+LIBGLOB = @LIBGLOB@
 LIBPLPLOT = @LIBPLPLOT@
 LIBREADLINE = @LIBREADLINE@
 LIBKPATHSEA = @LIBKPATHSEA@
@@ -332,6 +333,7 @@
   -e "s;%LDFLAGS%;\"${LDFLAGS}\";" \
   -e "s;%LEXLIB%;\"${LEXLIB}\";" \
   -e "s;%LIBDLFCN%;\"${LIBDLFCN}\";" \
+  -e "s;%LIBGLOB%;\"${LIBGLOB}\";" \
   -e "s;%LIBFLAGS%;\"-L${octlibdir}\";" \
   -e "s;%LIBPLPLOT%;\"${LIBPLPLOT}\";" \
   -e "s;%LIBS%;\"${LIBS}\";" \
--- a/acconfig.h
+++ b/acconfig.h
@@ -6,6 +6,10 @@
    Leave the following blank line there!!  Autoheader needs it.  */
 
 
+/* Define if your version of GNU libc has buggy inline assembly code
+   for math functions like exp.  */
+#undef __NO_MATH_INLINES
+
 /* Define if you want bounds checking on element references for
    internal array and matrix classes. */
 #undef BOUNDS_CHECKING
--- a/configure.in
+++ b/configure.in
@@ -21,7 +21,7 @@
 ### Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 ### 02111-1307, USA. 
 
-AC_REVISION($Revision: 1.309 $)
+AC_REVISION($Revision: 1.310 $)
 AC_PREREQ(2.9)
 AC_INIT(src/octave.cc)
 AC_CONFIG_HEADER(config.h)
@@ -158,6 +158,13 @@
   AC_DEFINE(BOUNDS_CHECKING, 1)
 fi
 
+### It seems that there are some broken inline assembly functions in
+### the GNU libc.  Since I'm not sure how to test whether we are using
+### GNU libc, just disable them for all platforms.
+
+AC_MSG_RESULT([defining __NO_MATH_INLINES avoids buggy GNU libc exp function])
+AC_DEFINE(__NO_MATH_INLINES, 1)
+
 ### See which C++ compiler to use (we expect to find g++).
 
 EXTERN_CXXFLAGS="$CXXFLAGS"
@@ -1132,19 +1139,19 @@
 
 ### Do the substitutions in all the Makefiles.
 
-AC_OUTPUT(Makefile octMakefile Makeconf install-octave
-  test/Makefile dlfcn/Makefile
-  doc/Makefile doc/faq/Makefile doc/interpreter/Makefile
-  doc/liboctave/Makefile doc/refcard/Makefile emacs/Makefile
-  examples/Makefile liboctave/Makefile src/Makefile
-  libcruft/Makefile libcruft/Makerules
-  libcruft/blas/Makefile libcruft/dassl/Makefile
-  libcruft/fftpack/Makefile libcruft/lapack/Makefile
-  libcruft/linpack/Makefile libcruft/minpack/Makefile
-  libcruft/misc/Makefile libcruft/odepack/Makefile
-  libcruft/ordered-qz/Makefile libcruft/quadpack/Makefile
-  libcruft/ranlib/Makefile libcruft/specfun/Makefile
-  libcruft/slatec-fn/Makefile libcruft/slatec-err/Makefile
+AC_OUTPUT(Makefile octMakefile Makeconf install-octave \
+  test/Makefile dlfcn/Makefile \
+  doc/Makefile doc/faq/Makefile doc/interpreter/Makefile \
+  doc/liboctave/Makefile doc/refcard/Makefile emacs/Makefile \
+  examples/Makefile liboctave/Makefile src/Makefile \
+  libcruft/Makefile libcruft/Makerules \
+  libcruft/blas/Makefile libcruft/dassl/Makefile \
+  libcruft/fftpack/Makefile libcruft/lapack/Makefile \
+  libcruft/linpack/Makefile libcruft/minpack/Makefile \
+  libcruft/misc/Makefile libcruft/odepack/Makefile \
+  libcruft/ordered-qz/Makefile libcruft/quadpack/Makefile \
+  libcruft/ranlib/Makefile libcruft/specfun/Makefile \
+  libcruft/slatec-fn/Makefile libcruft/slatec-err/Makefile \
   libcruft/villad/Makefile)
 
 chmod 755 install-octave
--- a/liboctave/ChangeLog
+++ b/liboctave/ChangeLog
@@ -1,3 +1,20 @@
+Tue Nov 10 07:53:15 1998  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* byte-swap.h (swap_bytes, swap_2_bytes, swap_4_bytes, swap_8_bytes): 
+	Add volatile qualifier to void* arg.
+	Cast volatile void* arg to volatile char*.
+
+Mon Nov  9 08:28:31 1998  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* cmd-edit.h (command_editor::do_set_event_hook): New function.
+	(command_editor::do_restore_event_hook): Ditto.
+	* cmd-edit.cc (command_editor::set_event_hook): Ditto.
+	(command_editor::restore_event_hook): Ditto.
+	(gnu_readline::do_set_event_hook): Ditto.
+	(gnu_readline::do_restore_event_hook): Ditto.
+	(gnu_readline::previous_event_hook): New data member.
+	(gnu_readline::gnu_readline): Initialize previous_event_hook.
+
 Mon Nov  2 13:36:04 1998  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
 	* Makefile.in (BINDISTLIBS): Don't include .$(SHLEXT_VER) in name.
--- a/liboctave/byte-swap.h
+++ b/liboctave/byte-swap.h
@@ -23,10 +23,13 @@
 #if !defined (octave_byte_swap_h)
 #define octave_byte_swap_h 1
 
+// XXX FIXME XXX -- not sure these volatile qualifiers are really
+// needed or appropriate here.
+
 static inline void
-swap_bytes (void *ptr, unsigned int i, unsigned int j)
+swap_bytes (volatile void *ptr, unsigned int i, unsigned int j)
 {
-  char *t = static_cast<char *> (ptr);
+  volatile char *t = static_cast<volatile char *> (ptr);
 
   char tmp = t[i];
   t[i] = t[j];
@@ -34,26 +37,26 @@
 }
 
 static inline void
-swap_2_bytes (void *ptr)
+swap_2_bytes (volatile void *ptr)
 {
-  char *t = static_cast<char *> (ptr);
+  volatile char *t = static_cast<volatile char *> (ptr);
 
   swap_bytes (t, 0, 1);
 }
 
 static inline void
-swap_4_bytes (void *ptr)
+swap_4_bytes (volatile void *ptr)
 {
-  char *t = static_cast<char *> (ptr);
+  volatile char *t = static_cast<volatile char *> (ptr);
 
   swap_bytes (t, 0, 3);
   swap_bytes (t, 1, 2);
 }
 
 static inline void
-swap_8_bytes (void *ptr)
+swap_8_bytes (volatile void *ptr)
 {
-  char *t = static_cast<char *> (ptr);
+  volatile char *t = static_cast<volatile char *> (ptr);
 
   swap_bytes (t, 0, 7);
   swap_bytes (t, 1, 6);
@@ -62,9 +65,9 @@
 }
 
 static inline void
-swap_2_bytes (void *ptr, int len)
+swap_2_bytes (volatile void *ptr, int len)
 {
-  char *t = static_cast<char *> (ptr);
+  volatile char *t = static_cast<volatile char *> (ptr);
 
   for (int i = 0; i < len; i++)
     {
@@ -74,9 +77,9 @@
 }
 
 static inline void
-swap_4_bytes (void *ptr, int len)
+swap_4_bytes (volatile void *ptr, int len)
 {
-  char *t = static_cast<char *> (ptr);
+  volatile char *t = static_cast<volatile char *> (ptr);
 
   for (int i = 0; i < len; i++)
     {
@@ -86,9 +89,9 @@
 }
 
 static inline void
-swap_8_bytes (void *ptr, int len)
+swap_8_bytes (volatile void *ptr, int len)
 {
-  char *t = static_cast<char *> (ptr);
+  volatile char *t = static_cast<volatile char *> (ptr);
 
   for (int i = 0; i < len; i++)
     {
--- a/liboctave/cmd-edit.cc
+++ b/liboctave/cmd-edit.cc
@@ -114,6 +114,10 @@
 
   void do_restore_startup_hook (void);
 
+  void do_set_event_hook (fcn f);
+
+  void do_restore_event_hook (void);
+
   void do_read_init_file (const string& file);
 
   static void operate_and_get_next (int, int);
@@ -122,6 +126,8 @@
 
   fcn previous_startup_hook;
 
+  fcn previous_event_hook;
+
   completion_fcn completion_function;
 
   static char *command_generator (const char *text, int state);
@@ -130,7 +136,8 @@
 };
 
 gnu_readline::gnu_readline ()
-  : command_editor (), previous_startup_hook (0), completion_function (0)
+  : command_editor (), previous_startup_hook (0),
+    previous_event_hook (0), completion_function (0)
 {
   rl_initialize ();
 
@@ -326,6 +333,20 @@
 }
 
 void
+gnu_readline::do_set_event_hook (fcn f)
+{
+  previous_event_hook = rl_event_hook;
+
+  rl_event_hook = f;
+}
+
+void
+gnu_readline::do_restore_event_hook (void)
+{
+  rl_event_hook = previous_event_hook;
+}
+
+void
 gnu_readline::do_read_init_file (const string& file)
 {
   if (file.empty ())
@@ -662,6 +683,20 @@
 }
 
 void
+command_editor::set_event_hook (fcn f)
+{
+  if (instance_ok ())
+    instance->do_set_event_hook (f);
+}
+
+void
+command_editor::restore_event_hook (void)
+{
+  if (instance_ok ())
+    instance->do_restore_event_hook ();
+}
+
+void
 command_editor::read_init_file (const string& file)
 {
   if (instance_ok ())
--- a/liboctave/cmd-edit.h
+++ b/liboctave/cmd-edit.h
@@ -85,6 +85,10 @@
 
   static void restore_startup_hook (void);
 
+  static void set_event_hook (fcn f);
+
+  static void restore_event_hook (void);
+
   static void read_init_file (const string& file = string ());
 
   static int current_command_number (void);
@@ -158,6 +162,10 @@
 
   virtual void do_restore_startup_hook (void) { }
 
+  virtual void do_set_event_hook (fcn) { }
+
+  virtual void do_restore_event_hook (void) { }
+
   virtual void do_read_init_file (const string&) { }
 
   int read_octal (const string& s);
--- a/octave-bug.in
+++ b/octave-bug.in
@@ -39,6 +39,7 @@
 LIBS=%LIBS%
 LEXLIB=%LEXLIB%
 LIBPLPLOT=%LIBPLPLOT%
+LIBGLOB=%LIBGLOB%
 LIBDLFCN=%LIBDLFCN%
 DEFS=%DEFS%
 
@@ -185,6 +186,7 @@
 LEXLIB:           $LEXLIB
 LIBPLPLOT:        $LIBPLPLOT
 LIBDLFCN:         $LIBDLFCN
+LIBGLOB:          $LIBGLOB
 DEFS:
 
 EOF
--- a/scripts/ChangeLog
+++ b/scripts/ChangeLog
@@ -1,3 +1,63 @@
+Fri Nov  6 10:17:00 1998  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* New files from OCST, in control subdiretory:
+
+	    DEMOcontrol.m      is_siso.m          syschnames.m
+	    abcddim.m          is_stabilizable.m  syschnamesl.m
+	    abcddims.m         is_stable.m        syschtsam.m
+	    analdemo.m         jet707.m           sysconnect.m
+	    are.m              lqe.m              syscont.m
+	    axis2dlim.m        lqg.m              syscont_disc.m
+	    bddemo.m           lqr.m              sysdefioname.m
+	    bode.m             lsim.m             sysdefstname.m
+	    bode_bounds.m      ltifr.m            sysdimensions.m
+	    bodquist.m         lyap.m             sysdisc.m
+	    buildssic.m        mb.m               sysdup.m
+	    c2d.m              minfo.m            sysgetsignals.m
+	    com2str.m,v        moddemo.m          sysgettsam.m
+	    controldemo.m      nichols.m          sysgettype.m
+	    ctrb.m             nyquist.m          sysgroup.m
+	    d2c.m              obsv.m             sysgroupn.m
+	    damp.m             ord2.m             sysmult.m
+	    dare.m             outlist.m          sysout.m
+	    dcgain.m           packedform.m       sysprune.m
+	    demomarsyas.m      packsys.m          sysreorder.m
+	    dezero.m;          parallel.m         sysrepdemo.m
+	    dgkfdemo.m         place.m            sysscale.m
+	    dgram.m            polyout.m          syssub.m
+	    dhinfdemo.m        prompt.m           sysupdate.m
+	    dlqe.m             pzmap.m            tf2ss.m
+	    dlqg.m             qzval.m            tf2sys.m
+	    dlqr.m             rldemo.m           tf2sysl.m
+	    dlyap.m            rlocus.m           tf2zp.m
+	    dmr2d.m            rotg.m             tfout.m
+	    fir2sys.m          run_cmd.m;         tzero.m
+	    frdemo.m           series.m           tzero2.m
+	    freqchkw.m         sortcom.m          ugain.m
+	    freqresp.m         ss2sys.m           unpacksys.m
+	    gram.m             ss2tf.m            wgt1o.m
+	    h2norm.m           ss2zp.m            zgfmul.m
+	    h2syn.m            starp.m            zgfslv.m
+	    hinf_ctr.m         step.m             zginit.m
+	    hinfdemo.m         stepimp.m          zgpbal.m
+	    hinfnorm.m         strappend.m;       zgreduce.m
+	    hinfsyn.m          susball.m          zgrownorm.m
+	    hinfsyn_chk.m      swap.m             zgscal.m
+	    impulse.m          swapcols.m         zgsgiv.m
+	    is_abcd.m          swaprows.m         zgshsr.m
+	    is_controllable.m  sys2fir.m          zp2ss.m
+	    is_detectable.m    sys2ss.m           zp2ssg2.m
+	    is_dgkf.m          sys2tf.m           zp2sys.m
+	    is_digital.m       sys2zp.m           zp2tf.m
+	    is_observable.m    sysadd.m           zpout.m
+	    is_sample.m        sysappend.m
+
+Thu Nov  5 13:28:40 1998  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* configure.in (AC_OUTPUT): Escape newlinew in macro call with \.
+
+	* strings/deblank.m: Make it work for string arrays too.
+
 Wed Nov  4 21:51:13 1998  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
 	* linear-algebra/housh.m: New file from the OCST.
--- a/scripts/configure.in
+++ b/scripts/configure.in
@@ -26,11 +26,11 @@
 
 AC_PROG_INSTALL
 
-AC_OUTPUT(Makefile audio/Makefile control/Makefile elfun/Makefile
-	  finance/Makefile general/Makefile image/Makefile io/Makefile
-	  linear-algebra/Makefile miscellaneous/Makefile plot/Makefile
-	  polynomial/Makefile set/Makefile signal/Makefile
-	  specfun/Makefile special-matrix/Makefile startup/Makefile
-	  statistics/Makefile statistics/base/Makefile
-	  statistics/distributions/Makefile statistics/models/Makefile
+AC_OUTPUT(Makefile audio/Makefile control/Makefile elfun/Makefile \
+	  finance/Makefile general/Makefile image/Makefile io/Makefile \
+	  linear-algebra/Makefile miscellaneous/Makefile plot/Makefile \
+	  polynomial/Makefile set/Makefile signal/Makefile \
+	  specfun/Makefile special-matrix/Makefile startup/Makefile \
+	  statistics/Makefile statistics/base/Makefile \
+	  statistics/distributions/Makefile statistics/models/Makefile \
 	  statistics/tests/Makefile strings/Makefile time/Makefile)
--- a/scripts/strings/deblank.m
+++ b/scripts/strings/deblank.m
@@ -41,8 +41,8 @@
       t = "";
     else
       s = reshape (s, 1, len);
-      k = max (find (s != " "));
-      t = s (1:k);
+      k = ceil (max (find (s != " ")) / nr) * nr;
+      t = reshape (s (1:k), nr, k / nr);
     endif
 
   else
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,36 @@
+Mon Nov  9 16:12:37 1998  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* pr-output.cc (octave_print_internal): Reorder default args for
+	charMatrix version.
+	(octave_print_internal): New function for boolMatrix.
+
+	* version.h (OCTAVE_STARTUP_MESSAGE): Note that this is a
+	development release.
+
+	* toplev.cc (do_octave_atexit): Call flush_octave_stdout here.
+	(clean_up_for_exit): And here.
+
+Mon Nov  9 15:20:53 1998  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* input.cc (get_user_input): Check retval.length(), not	retval.length.
+
+Sun Nov  8 19:30:33 1998  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* pt-assign.cc (tree_simple_assignment::rvalue): If etype is
+	asn_eq, don't evaluate ult again because retval is just rhs value.
+	(tree_multi_assignment::rvalue): Likewise.
+
+Fri Nov  6 12:14:29 1998  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* pt-loop.cc (tree_for_command::eval): Move code for string RHS
+	outside if clause for matrix types.
+
+	* pt-idx.cc: Don't forget to define arg_nm.
+	Move contstructor here.
+	* pt-idx.h: From here.
+
+	* data.cc (Fisempty): Also return true for empty strings.
+
 Wed Nov  4 17:21:41 1998  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
 	* ov-base.cc (octave_base_value::rows, octave_base_value::columns,
--- a/src/data.cc
+++ b/src/data.cc
@@ -782,7 +782,7 @@
 }
 
 DEFUN (isempty, args, ,
-  "isempty (x): return nonzero if x is an empty matrix or empty list")
+  "isempty (x): return nonzero if x is an empty matrix, string, or list")
 {
   double retval = 0.0;
 
@@ -792,7 +792,7 @@
 
       if (arg.is_matrix_type ())
 	retval = static_cast<double> (arg.rows () == 0 || arg.columns () == 0);
-      else if (arg.is_list ())
+      else if (arg.is_list () || arg.is_string ())
 	retval = static_cast<double> (arg.length () == 0);
     }
   else
--- a/src/input.cc
+++ b/src/input.cc
@@ -564,7 +564,7 @@
 
 	  retval = eval_string (input_buf, silent, parse_status, nargout);
 
-	  if (! debug && retval.length == 0)
+	  if (! debug && retval.length () == 0)
 	    retval(0) = Matrix ();
 	}
     }
--- a/src/pr-output.cc
+++ b/src/pr-output.cc
@@ -1577,9 +1577,19 @@
 }
 
 void
+octave_print_internal (ostream& os, const boolMatrix& bm,
+		       bool pr_as_read_syntax,
+		       int extra_indent)
+{
+  Matrix tmp (bm);
+  octave_print_internal (os, tmp, pr_as_read_syntax, extra_indent);
+}
+
+void
 octave_print_internal (ostream& os, const charMatrix& chm,
-		       bool pr_as_read_syntax, bool pr_as_string,
-		       int /* extra_indent XXX FIXME XXX */)
+		       bool pr_as_read_syntax,
+		       int /* extra_indent XXX FIXME XXX */,
+		       bool pr_as_string)
 {
   if (pr_as_string)
     {
--- a/src/pr-output.h
+++ b/src/pr-output.h
@@ -30,6 +30,7 @@
 class ComplexMatrix;
 class Matrix;
 class Range;
+class boolMatrix;
 class charMatrix;
 
 extern void
@@ -56,10 +57,15 @@
 		       int extra_indent = 0);
 
 extern void
+octave_print_internal (ostream& os, const boolMatrix& m,
+		       bool pr_as_read_syntax = false,
+		       int extra_indent = 0);
+
+extern void
 octave_print_internal (ostream& os, const charMatrix& chm,
 		       bool pr_as_read_syntax = false,
-		       bool pr_as_string = false,
-		       int extra_indent = 0);
+		       int extra_indent = 0,
+		       bool pr_as_string = false);
 
 #endif
 
--- a/src/pt-assign.cc
+++ b/src/pt-assign.cc
@@ -104,32 +104,38 @@
 		{
 		  ult.assign (etype, rhs_val);
 
-		  retval = ult.value ();
+		  if (! error_state)
+		    {
+		      if (etype == octave_value::asn_eq)
+			retval = rhs_val;
+		      else
+			retval = ult.value ();
 
-		  if (error_state)
-		    eval_error ();
-		  else if (print_result ())
-		    {
-		      if (Vprint_rhs_assign_val)
-			retval.print_with_name (octave_stdout,
-						lhs->str_print_code ());
-		      else
+		      if (print_result ())
 			{
-			  // We clear any index here so that we can
-			  // get the new value of the referenced
-			  // object below, instead of the indexed
-			  // value (which should be the same as the
-			  // right hand side value).
+			  if (Vprint_rhs_assign_val)
+			    retval.print_with_name (octave_stdout,
+						    lhs->str_print_code ());
+			  else
+			    {
+			      // We clear any index here so that we can
+			      // get the new value of the referenced
+			      // object below, instead of the indexed
+			      // value (which should be the same as the
+			      // right hand side value).
 
-			  ult.clear_index ();
+			      ult.clear_index ();
 
-			  octave_value lhs_val = ult.value ();
+			      octave_value lhs_val = ult.value ();
 
-			  if (! error_state)
-			    lhs_val.print_with_name (octave_stdout,
-						     lhs->name ());
+			      if (! error_state)
+				lhs_val.print_with_name (octave_stdout,
+							 lhs->name ());
+			    }
 			}
 		    }
+		  else
+		    eval_error ();
 		}
 	    }
 	}
@@ -235,7 +241,13 @@
 			{
 			  ult.assign (etype, rhs_val(k));
 
-			  retval(k) = ult.value ();
+			  if (! error_state)
+			    {
+			      if (etype == octave_value::asn_eq)
+				retval(k) = rhs_val(k);
+			      else
+				retval(k) = ult.value ();
+			    }
 			}
 		      else
 			error ("element number %d undefined in return list",
--- a/src/pt-idx.cc
+++ b/src/pt-idx.cc
@@ -38,6 +38,12 @@
 
 // Index expressions.
 
+tree_index_expression::tree_index_expression (tree_expression *e = 0,
+					      tree_argument_list *lst = 0,
+					      int l = -1, int c = -1)
+  : tree_expression (l, c), expr (e), list (lst),
+    arg_nm (lst ? lst->get_arg_names () : string_vector ()) { }
+
 tree_index_expression::~tree_index_expression (void)
 {
   delete expr;
--- a/src/pt-idx.h
+++ b/src/pt-idx.h
@@ -47,8 +47,7 @@
 public:
 
   tree_index_expression (tree_expression *e = 0, tree_argument_list *lst = 0,
-			 int l = -1, int c = -1)
-    : tree_expression (l, c), expr (e), list (lst), arg_nm () { }
+			 int l = -1, int c = -1);
 
   ~tree_index_expression (void);
 
--- a/src/pt-loop.cc
+++ b/src/pt-loop.cc
@@ -215,22 +215,41 @@
 
       do_for_loop_once (ult, rhs, quit);
     }
+  else if (rhs.is_string ())
+    {
+      charMatrix chm_tmp = rhs.char_matrix_value ();
+      int nr = chm_tmp.rows ();
+      int steps = chm_tmp.columns ();
+
+      if (error_state)
+	return;
+
+      if (nr == 1)
+	DO_LOOP (chm_tmp (0, i));
+      else
+	{
+	  for (int i = 0; i < steps; i++)
+	    {
+	      octave_value val (chm_tmp.extract (0, i, nr-1, i), true);
+
+	      bool quit = false;
+
+	      do_for_loop_once (ult, val, quit);
+
+	      if (quit)
+		break;
+	    }
+	}
+    }
   else if (rhs.is_matrix_type ())
     {
-      charMatrix chm_tmp;
       Matrix m_tmp;
       ComplexMatrix cm_tmp;
 
       int nr;
       int steps;
 
-      if (rhs.is_string ())
-	{
-	  chm_tmp = rhs.char_matrix_value ();
-	  nr = chm_tmp.rows ();
-	  steps = chm_tmp.columns ();
-	}
-      else if (rhs.is_real_matrix ())
+      if (rhs.is_real_matrix ())
 	{
 	  m_tmp = rhs.matrix_value ();
 	  nr = m_tmp.rows ();
@@ -246,26 +265,7 @@
       if (error_state)
 	return;
 
-      if (rhs.is_string ())
-	{
-	  if (nr == 1)
-	    DO_LOOP (chm_tmp (0, i));
-	  else
-	    {
-	      for (int i = 0; i < steps; i++)
-		{
-		  octave_value val (chm_tmp.extract (0, i, nr-1, i), true);
-
-		  bool quit = false;
-
-		  do_for_loop_once (ult, val, quit);
-
-		  if (quit)
-		    break;
-		}
-	    }
-	}
-      else if (rhs.is_real_matrix ())
+      if (rhs.is_real_matrix ())
 	{
 	  if (nr == 1)
 	    DO_LOOP (m_tmp (0, i));
--- a/src/toplev.cc
+++ b/src/toplev.cc
@@ -182,6 +182,8 @@
 
   cleanup_tmp_files ();
 
+  flush_octave_stdout ();
+
   if (!quitting_gracefully && (interactive || forced_interactive))
     cout << "\n";
 }
@@ -512,6 +514,8 @@
       octave_value_list fcn = octave_atexit_functions.pop ();
 
       feval (fcn, 0);
+
+      flush_octave_stdout ();
     }
 }