# # # patch "ChangeLog" # from [040d336864e2e362aa5215884ccfe07fa608f871] # to [dba4392d56296ac055ed2f025c62116e824fea3d] # # patch "netxx/osutil.cxx" # from [c66309a0ef2fb9088ee834459b8dde72fe0999a4] # to [111212068cb72bfa2c9e0aa66ffb663db5ac335f] # # patch "netxx/osutil.h" # from [2d6b18c5ab154f0583ef11a42f3670ec13cb7ce7] # to [74df9538ae587f638afa95772b582ad5d173c70a] # ============================================================ --- ChangeLog 040d336864e2e362aa5215884ccfe07fa608f871 +++ ChangeLog dba4392d56296ac055ed2f025c62116e824fea3d @@ -1,11 +1,14 @@ 2006-05-25 Matthew Gregan * cmd_merging.cc (CMD(update)): Report branch switch after reporting updated files so that the user is less likely to miss the message. - * netxx/osutil.cxx: Mark string table static const. + * netxx/osutil.cxx: Mark string table static const. Trim any + trailing line feeds from message returned from FormatMessage. + * netxx/osutil.h: error_type is a DWORD on Win32. + 2006-05-24 Matthew Gregan * win32/get_system_flavour.cc: Report service pack number, if any ============================================================ --- netxx/osutil.cxx c66309a0ef2fb9088ee834459b8dde72fe0999a4 +++ netxx/osutil.cxx 111212068cb72bfa2c9e0aa66ffb663db5ac335f @@ -60,10 +60,15 @@ // try FormatMessage first--this will probably fail for anything < Win2k. LPTSTR msg; - if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM, + DWORD len; + if ((len = FormatMessage( + FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM, 0, errnum, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), reinterpret_cast(&msg), 0, - static_cast(0)) != 0) { + static_cast(0))) != 0) { + for (LPTSTR p = msg + len - 1; p > msg; --p) + if (*p == '\r' || *p == '\n') + *p = '\0'; s << msg; LocalFree(msg); } else { ============================================================ --- netxx/osutil.h 2d6b18c5ab154f0583ef11a42f3670ec13cb7ce7 +++ netxx/osutil.h 74df9538ae587f638afa95772b582ad5d173c70a @@ -84,7 +84,11 @@ namespace Netxx { +#if defined (WIN32) + typedef DWORD error_type; +#else typedef int error_type; +#endif error_type get_last_error (void); std::string str_error(error_type);