[EMAIL PROTECTED] (Lars Gullik Bjønnes) writes: | We are reading a string that is longer than 1024 chars. | It would be interesting to see if we could the the #else part to work. | Then this problem would most likely be solved. > | Would you be able to set "#if 0" and try again... this patch should | make that happen: > | diff -u -p -r1.52 lyxstring.C | --- lyxstring.C 21 Mar 2002 17:06:35 -0000 1.52 | +++ lyxstring.C 6 Apr 2002 11:13:12 -0000 | @@ -1740,7 +1743,7 @@ istream & operator>>(istream & is, lyxst | if (!tmp.empty()) s = tmp; | #else | // better solution | - int w = is.widdth(0); | + int w = is.width(0); | s.clear(); | char c = 0; | while (is.get(c)) { | @@ -1748,7 +1751,7 @@ istream & operator>>(istream & is, lyxst | s += c; | if (--w == 1) break; | } | - if (s.empty()) is.setstate(ios::failbit); | + if (s.empty()) is.setstate(std::ios::failbit); | #endif | return is; | }
Ok, so this was a bug in lyxstring... fixed now... (hopefully) but there is also most likely a problem in getExtFromContents ... it uses string str; ifs >> str; this only reads from ifs until ' ' or '\n' or eof is reached, I guess it would be more correct to read a whole line and do the checks on that. something like... string str; getline(ifs, str); should be enough. -- Lgb