]> git.lyx.org Git - lyx.git/blobdiff - src/support/docstring.C
remove unused stuff
[lyx.git] / src / support / docstring.C
index 7ee1923df9909c87f31ca9e8caf36e2895f63462..5e8d05f715bc852294f085f68a0402c94f624d11 100644 (file)
@@ -465,9 +465,14 @@ protected:
                std::ios_base::iostate & err, long & v) const
        {
                std::string s;
-               s.resize(64);
-               for (int i = 0; iit != eit && isNumpunct(*iit); ++i, ++iit)
-                       s[i] = static_cast<char>(*iit);
+               s.reserve(64);
+               for (; iit != eit && isNumpunct(*iit); ++iit)
+                       s += static_cast<char>(*iit);
+               // We add another character, not part of the numpunct facet,
+               // in order to avoid setting the eofbit in the stream state,
+               // which would prevent any further read. The space seems a
+               // good choice here.
+               s += ' ';
                string_num_get_facet f;
                f.get(s.begin(), s.end(), b, err, v);