mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 18:14:25 +03:00
* util.c (unix_error_string): Convert error string from UTF-8 is
glib 2 is used.
This commit is contained in:
parent
70b4cd6ff1
commit
d3f2f521dc
@ -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.
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user