Author: aschnell Date: Sun Aug 10 23:49:11 2008 New Revision: 49905 URL: http://svn.opensuse.org/viewcvs/yast?rev=49905&view=rev Log: - imbue stream with classic locale (workaround for bug #416096) Modified: trunk/storage/libstorage/src/AppUtil.h trunk/storage/libstorage/src/Disk.cc Modified: trunk/storage/libstorage/src/AppUtil.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/AppUtil.h?rev=49905&r1=49904&r2=49905&view=diff ============================================================================== --- trunk/storage/libstorage/src/AppUtil.h (original) +++ trunk/storage/libstorage/src/AppUtil.h Sun Aug 10 23:49:11 2008 @@ -8,6 +8,7 @@ #include <cstdio> #include <fstream> #include <sstream> +#include <locale> #include <string> #include <list> #include <map> @@ -45,6 +46,14 @@ bool isNfsDev( const string& dev ); unsigned getMajorDevices( const string& driver ); + +template<class StreamType> +void classic(StreamType& stream) +{ + stream.imbue(std::locale::classic()); +} + + void createLogger(const string& component, const string& name, const string& logpath, const string& logfile); @@ -72,17 +81,21 @@ #define y2log_op(level, file, line, function, op) \ do { \ std::ostringstream __buf; \ + classic(__buf); \ __buf << op; \ logMsg(level, file, line, function, __buf.str()); \ } while (0) + string sformat(const char* format, ...); + string byteToHumanString(unsigned long long size, bool classic, int precision, bool omit_zeroes); bool humanStringToByte(const string& str, bool classic, unsigned long long& size); + inline const char* _(const char* msgid) { return dgettext("storage", msgid); @@ -93,6 +106,7 @@ return dngettext("storage", msgid, msgid_plural, n); } + extern const string app_ws; } Modified: trunk/storage/libstorage/src/Disk.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Disk.cc?rev=49905&r1=49904&r2=49905&view=diff ============================================================================== --- trunk/storage/libstorage/src/Disk.cc (original) +++ trunk/storage/libstorage/src/Disk.cc Sun Aug 10 23:49:11 2008 @@ -626,6 +626,7 @@ y2debug( "Line: %s", Line.c_str() ); std::istringstream Data( Line ); + classic(Data); nr=0; StartM = EndM = 0; @@ -639,7 +640,7 @@ { Data >> nr >> StartM >> skip >> EndM >> skip >> skip; } - if( !Data.good() ) + if (Data.fail()) { y2mil( "invalid line:" << Line ); nr = 0; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org