# HG changeset patch # User jwe # Date 1055516906 0 # Node ID 82f8aae8cf2093cfd70fdf0f83f355e32343b841 # Parent ab82d3a27d96429d3c7805229f169ed3d2e980db [project @ 2003-06-13 15:08:25 by jwe] diff -r ab82d3a27d96 -r 82f8aae8cf20 src/ChangeLog --- a/src/ChangeLog Fri Jun 13 14:35:25 2003 +0000 +++ b/src/ChangeLog Fri Jun 13 15:08:26 2003 +0000 @@ -1,3 +1,8 @@ +2003-06-13 John W. Eaton + + * oct-stream.cc (printf_value_cache::string_value): Don't attempt + to extract values when none are available. + 2003-06-04 John W. Eaton * pt-plot.cc (Vgnuplot_has_multiplot): Delete variable. diff -r ab82d3a27d96 -r 82f8aae8cf20 src/oct-stream.cc --- a/src/oct-stream.cc Fri Jun 13 14:35:25 2003 +0000 +++ b/src/oct-stream.cc Fri Jun 13 15:08:26 2003 +0000 @@ -2175,31 +2175,36 @@ { std::string retval; - octave_value tval = values (val_idx++); - - if (tval.rows () == 1) - retval = tval.string_value (); + if (exhausted ()) + curr_state = conversion_error; else { - // In the name of Matlab compatibility. - - charMatrix chm = tval.char_matrix_value (); - - int nr = chm.rows (); - int nc = chm.columns (); - - int k = 0; - - retval.resize (nr * nc, '\0'); - - for (int j = 0; j < nc; j++) - for (int i = 0; i < nr; i++) - retval[k++] = chm(i,j); + octave_value tval = values (val_idx++); + + if (tval.rows () == 1) + retval = tval.string_value (); + else + { + // In the name of Matlab compatibility. + + charMatrix chm = tval.char_matrix_value (); + + int nr = chm.rows (); + int nc = chm.columns (); + + int k = 0; + + retval.resize (nr * nc, '\0'); + + for (int j = 0; j < nc; j++) + for (int i = 0; i < nr; i++) + retval[k++] = chm(i,j); + } + + if (error_state) + curr_state = conversion_error; } - if (error_state) - curr_state = conversion_error; - return retval; }