summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ee99512)
raw | patch | inline | side by side (parent: ee99512)
author | Max Kellermann <max@duempel.org> | |
Thu, 2 Oct 2008 17:01:04 +0000 (19:01 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Thu, 2 Oct 2008 17:01:04 +0000 (19:01 +0200) |
Don't pass "noconvert" to charset_init(). Let charset_init()
determine that with g_get_charset() and return its name.
determine that with g_get_charset() and return its name.
src/charset.c | patch | blob | history | |
src/charset.h | patch | blob | history | |
src/main.c | patch | blob | history |
diff --git a/src/charset.c b/src/charset.c
index aaec39c72c8a16e6772df16e3a41eef81a93a0e6..701fd2105bd6eb1afaf5a4e8a67cb64170c8abc3 100644 (file)
--- a/src/charset.c
+++ b/src/charset.c
extern void screen_status_printf(const char *format, ...);
static bool noconvert = true;
+static const char *charset;
-void
-charset_init(bool disable)
+const char *
+charset_init(void)
{
- noconvert = disable;
+ noconvert = g_get_charset(&charset);
+ return charset;
}
unsigned
&wb, &rb,
&error);
if (error) {
- const char *charset;
-
- g_get_charset(&charset);
screen_status_printf(_("Error: Unable to convert characters to %s"),
charset);
g_error_free(error);
diff --git a/src/charset.h b/src/charset.h
index 24f7ef6322e019adc0b737679a57507db91196f3..70173d19c0ee00b070288370bbfb36df6e9e4b40 100644 (file)
--- a/src/charset.h
+++ b/src/charset.h
#include <stdbool.h>
#include <stddef.h>
-void charset_init(bool disable);
+const char *
+charset_init(void);
/**
* Returns the number of terminal cells occupied by this string.
diff --git a/src/main.c b/src/main.c
index 0a9f7cb59eebb57fad5ef9210fe2479cb73fb508..07198e7de9abbc4e3d79e92baff0a4e699198b39 100644 (file)
--- a/src/main.c
+++ b/src/main.c
/* charset */
setlocale(LC_CTYPE,"");
/* initialize charset conversions */
- charset_init(g_get_charset(&charset));
+ charset = charset_init();
#endif
/* initialize i18n support */