# HG changeset patch # User Rik # Date 1384452117 28800 # Node ID 079da800451b5167b3152dfd2e3a29c00647295d # Parent c17f06b50ac5640bfe7dc3a66e9312ae08c4165e Fix loading complex values with 'NA' saved in text format (bug #40575). * lo-utils.cc (read_inf_nan_na): Use is.putback to put back the character that was checked to see if it was 'N' for "NaN" rather than "NA". diff -r c17f06b50ac5 -r 079da800451b liboctave/util/lo-utils.cc --- a/liboctave/util/lo-utils.cc Thu Nov 14 09:45:17 2013 -0800 +++ b/liboctave/util/lo-utils.cc Thu Nov 14 10:01:57 2013 -0800 @@ -202,8 +202,7 @@ return retval; } -// Note that the caller is responsible for repositioning the stream on -// failure. +// Note that the caller is responsible for repositioning the stream on failure. template T @@ -238,7 +237,10 @@ if (c2 == 'n' || c2 == 'N') val = std::numeric_limits::quiet_NaN (); else - val = octave_numeric_limits::NA (); + { + val = octave_numeric_limits::NA (); + is.putback (c2); + } } else is.setstate (std::ios::failbit);