* util.c (unix_error_string): Convert error string from UTF-8 is

glib 2 is used.
This commit is contained in:
Pavel Roskin 2003-05-29 04:33:38 +00:00
parent 70b4cd6ff1
commit d3f2f521dc
2 changed files with 11 additions and 0 deletions

View File

@ -1,5 +1,8 @@
2003-05-29 Koblinger Egmont <egmont@uhulinux.hu>
* util.c (unix_error_string): Convert error string from UTF-8 is
glib 2 is used.
* text.c (default_edition_colors): Change the default for
dhotfocus to be blue on cyan for consistency with dhotnormal.

View File

@ -763,9 +763,17 @@ char *x_basename (char *s)
char *unix_error_string (int error_num)
{
static char buffer [BUF_LARGE];
#if GLIB_MAJOR_VERSION >= 2
gchar *strerror_currentlocale;
strerror_currentlocale = g_locale_from_utf8(g_strerror (error_num), -1, NULL, NULL, NULL);
g_snprintf (buffer, sizeof (buffer), "%s (%d)",
strerror_currentlocale, error_num);
g_free(strerror_currentlocale);
#else
g_snprintf (buffer, sizeof (buffer), "%s (%d)",
g_strerror (error_num), error_num);
#endif
return buffer;
}