mirror of
https://github.com/irssi/irssi.git
synced 2024-11-03 04:27:19 -05:00
Simplify.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4403 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
41a2c3732a
commit
721650c300
@ -89,7 +89,6 @@ char *recode_in(const SERVER_REC *server, const char *str, const char *target)
|
|||||||
const char *to = NULL;
|
const char *to = NULL;
|
||||||
char *translit_to = NULL;
|
char *translit_to = NULL;
|
||||||
char *recoded = NULL;
|
char *recoded = NULL;
|
||||||
char *tagtarget = NULL;
|
|
||||||
gboolean term_is_utf8, str_is_utf8, translit, recode, autodetect;
|
gboolean term_is_utf8, str_is_utf8, translit, recode, autodetect;
|
||||||
int len;
|
int len;
|
||||||
int i;
|
int i;
|
||||||
@ -122,12 +121,11 @@ char *recode_in(const SERVER_REC *server, const char *str, const char *target)
|
|||||||
from = "UTF-8";
|
from = "UTF-8";
|
||||||
|
|
||||||
else {
|
else {
|
||||||
if (server != NULL && target != NULL)
|
if (server != NULL && server->tag != NULL && target != NULL) {
|
||||||
tagtarget = server->tag == NULL ? NULL :
|
char *tagtarget = g_strdup_printf("%s/%s", server->tag, target);
|
||||||
g_strdup_printf("%s/%s", server->tag, target);
|
|
||||||
if (tagtarget != NULL)
|
|
||||||
from = iconfig_get_str("conversions", tagtarget, NULL);
|
from = iconfig_get_str("conversions", tagtarget, NULL);
|
||||||
g_free(tagtarget);
|
g_free(tagtarget);
|
||||||
|
}
|
||||||
|
|
||||||
if (target != NULL && from == NULL)
|
if (target != NULL && from == NULL)
|
||||||
from = iconfig_get_str("conversions", target, 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) {
|
if (target) {
|
||||||
const char *to = NULL;
|
const char *to = NULL;
|
||||||
char *translit_to = NULL;
|
char *translit_to = NULL;
|
||||||
char *tagtarget = NULL;
|
|
||||||
|
|
||||||
if (server != NULL && target != NULL)
|
if (server != NULL && server->tag != NULL && target != NULL) {
|
||||||
tagtarget = server->tag == NULL ? NULL :
|
char *tagtarget = g_strdup_printf("%s/%s", server->tag, target);
|
||||||
g_strdup_printf("%s/%s", server->tag, target);
|
|
||||||
if (tagtarget != NULL)
|
|
||||||
to = iconfig_get_str("conversions", tagtarget, NULL);
|
to = iconfig_get_str("conversions", tagtarget, NULL);
|
||||||
g_free(tagtarget);
|
g_free(tagtarget);
|
||||||
|
}
|
||||||
if (to == NULL || *to == '\0')
|
if (to == NULL || *to == '\0')
|
||||||
to = iconfig_get_str("conversions", target, NULL);
|
to = iconfig_get_str("conversions", target, NULL);
|
||||||
if ((to == NULL || *to == '\0') && server != NULL)
|
if ((to == NULL || *to == '\0') && server != NULL)
|
||||||
|
Loading…
Reference in New Issue
Block a user