# HG changeset patch # User jwe # Date 1091490520 0 # Node ID e80587ad9503efafdf58c6be8124d451956d9b1a # Parent 90f51232d75182a5b3b0fa788dbcdc4010f1635d [project @ 2004-08-02 23:48:40 by jwe] diff -r 90f51232d751 -r e80587ad9503 src/ChangeLog --- a/src/ChangeLog Mon Aug 02 22:09:47 2004 +0000 +++ b/src/ChangeLog Mon Aug 02 23:48:40 2004 +0000 @@ -1,5 +1,8 @@ 2004-08-02 John W. Eaton + * oct-stream.cc (octave_scan): For %i format, recognize numbers + with leading 0x or 0X as hex and leading 0 as octal. + * OPERATORS/op-fcn-handle.cc: Delete. * Makefile.in (OP_XSRC): Delete it from the list. * pr-output.cc (octave_print_internal (std::ostream&, const diff -r 90f51232d751 -r e80587ad9503 src/oct-stream.cc --- a/src/oct-stream.cc Mon Aug 02 22:09:47 2004 +0000 +++ b/src/oct-stream.cc Mon Aug 02 23:48:40 2004 +0000 @@ -1094,11 +1094,38 @@ switch (fmt.type) { case 'o': - is >> std::oct >> ref; + is >> std::oct >> ref >> std::dec; break; case 'x': - is >> std::hex >> ref; + is >> std::hex >> ref >> std::dec; + break; + + case 'i': + { + int c1 = is.get (); + + if (! is.eof ()) + { + if (c1 == '0') + { + int c2 = is.peek (); + + is.putback (c1); + + if (c2 == 'x' || c2 == 'X') + is >> std::hex >> ref >> std::dec; + else + is >> std::oct >> ref >> std::dec; + } + else + { + is.putback (c1); + + is >> ref; + } + } + } break; default: