diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-03-03 15:28:16 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-03-03 15:28:16 -0800 |
commit | 00764406d78eb223b41536ad011b0f31735d532c (patch) | |
tree | 93ddb8a6395b29208b73db2c60214a25745cf86d /wutil.cpp | |
parent | 3ead99b0883c49d465a90a6746409003d7224190 (diff) |
Fix to preserve errno across certain calls to stop printing EOVERFLOW messages in weird places
Diffstat (limited to 'wutil.cpp')
-rw-r--r-- | wutil.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -372,6 +372,9 @@ const wchar_t *wgettext( const wchar_t *in ) { if( !in ) return in; + + // preserve errno across this since this is often used in printing error messages + int err = errno; wgettext_init_if_necessary(); @@ -384,6 +387,7 @@ const wchar_t *wgettext( const wchar_t *in ) char *out = gettext(mbs_in.c_str()); val = new wcstring(format_string(L"%s", out)); } + errno = err; return val->c_str(); } |