diff options
author | Emanuele Giaquinta <exg@irssi.org> | 2007-01-06 15:52:22 +0000 |
---|---|---|
committer | exg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2007-01-06 15:52:22 +0000 |
commit | 721650c300117e56f2343c88e337d1d8bfef6e5d (patch) | |
tree | c2d01116d76f6c84dbe18e9fee73e6daec0c7557 /src/core | |
parent | 41a2c3732a2fa85f87185cc134097d560a5015ff (diff) | |
download | irssi-721650c300117e56f2343c88e337d1d8bfef6e5d.zip |
Simplify.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4403 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/recode.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/core/recode.c b/src/core/recode.c index 79dd5065..1cbf3a69 100644 --- a/src/core/recode.c +++ b/src/core/recode.c @@ -89,7 +89,6 @@ char *recode_in(const SERVER_REC *server, const char *str, const char *target) const char *to = NULL; char *translit_to = NULL; char *recoded = NULL; - char *tagtarget = NULL; gboolean term_is_utf8, str_is_utf8, translit, recode, autodetect; int len; int i; @@ -122,12 +121,11 @@ char *recode_in(const SERVER_REC *server, const char *str, const char *target) from = "UTF-8"; else { - if (server != NULL && target != NULL) - tagtarget = server->tag == NULL ? NULL : - g_strdup_printf("%s/%s", server->tag, target); - if (tagtarget != NULL) + if (server != NULL && server->tag != NULL && target != NULL) { + char *tagtarget = g_strdup_printf("%s/%s", server->tag, target); from = iconfig_get_str("conversions", tagtarget, NULL); - g_free(tagtarget); + g_free(tagtarget); + } if (target != NULL && from == NULL) from = iconfig_get_str("conversions", target, NULL); @@ -186,14 +184,12 @@ char *recode_out(const SERVER_REC *server, const char *str, const char *target) if (target) { const char *to = NULL; char *translit_to = NULL; - char *tagtarget = NULL; - if (server != NULL && target != NULL) - tagtarget = server->tag == NULL ? NULL : - g_strdup_printf("%s/%s", server->tag, target); - if (tagtarget != NULL) + if (server != NULL && server->tag != NULL && target != NULL) { + char *tagtarget = g_strdup_printf("%s/%s", server->tag, target); to = iconfig_get_str("conversions", tagtarget, NULL); - g_free(tagtarget); + g_free(tagtarget); + } if (to == NULL || *to == '\0') to = iconfig_get_str("conversions", target, NULL); if ((to == NULL || *to == '\0') && server != NULL) |