From 2551e897ed7730bb60dfc119e1abffe155862269 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Fri, 25 Nov 2005 04:10:54 +0000 Subject: [PATCH] dont segv on empty bind param etc. matches. also a note for intle. SVN revision: 18639 --- src/bin/e_config.c | 33 ++++++++++++++++++++++----------- src/bin/e_intl.c | 1 + 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/bin/e_config.c b/src/bin/e_config.c index d0269aa..cb18e04 100644 --- a/src/bin/e_config.c +++ b/src/bin/e_config.c @@ -1711,8 +1711,10 @@ e_config_binding_mouse_match(E_Config_Binding_Mouse *eb_in) (eb->button == eb_in->button) && (eb->modifiers == eb_in->modifiers) && (eb->any_mod == eb_in->any_mod) && - (!strcmp(eb->action, eb_in->action)) && - (!strcmp(eb->params, eb_in->params))) + (((eb->action) && (eb_in->action) && (!strcmp(eb->action, eb_in->action))) || + ((!eb->action) && (!eb_in->action))) && + (((eb->params) && (eb_in->params) && (!strcmp(eb->params, eb_in->params))) || + ((!eb->params) && (!eb_in->params)))) return eb; } return NULL; @@ -1731,9 +1733,12 @@ e_config_binding_key_match(E_Config_Binding_Key *eb_in) if ((eb->context == eb_in->context) && (eb->modifiers == eb_in->modifiers) && (eb->any_mod == eb_in->any_mod) && - (!strcmp(eb->key, eb_in->key)) && - (!strcmp(eb->action, eb_in->action)) && - (!strcmp(eb->params, eb_in->params))) + (((eb->key) && (eb_in->key) && (!strcmp(eb->key, eb_in->key))) || + ((!eb->key) && (!eb_in->key))) && + (((eb->action) && (eb_in->action) && (!strcmp(eb->action, eb_in->action))) || + ((!eb->action) && (!eb_in->action))) && + (((eb->params) && (eb_in->params) && (!strcmp(eb->params, eb_in->params))) || + ((!eb->params) && (!eb_in->params)))) return eb; } return NULL; @@ -1752,10 +1757,14 @@ e_config_binding_signal_match(E_Config_Binding_Signal *eb_in) if ((eb->context == eb_in->context) && (eb->modifiers == eb_in->modifiers) && (eb->any_mod == eb_in->any_mod) && - (!strcmp(eb->signal, eb_in->signal)) && - (!strcmp(eb->source, eb_in->source)) && - (!strcmp(eb->action, eb_in->action)) && - (!strcmp(eb->params, eb_in->params))) + (((eb->signal) && (eb_in->signal) && (!strcmp(eb->signal, eb_in->signal))) || + ((!eb->signal) && (!eb_in->signal))) && + (((eb->source) && (eb_in->source) && (!strcmp(eb->source, eb_in->source))) || + ((!eb->source) && (!eb_in->source))) && + (((eb->action) && (eb_in->action) && (!strcmp(eb->action, eb_in->action))) || + ((!eb->action) && (!eb_in->action))) && + (((eb->params) && (eb_in->params) && (!strcmp(eb->params, eb_in->params))) || + ((!eb->params) && (!eb_in->params)))) return eb; } return NULL; @@ -1776,8 +1785,10 @@ e_config_binding_wheel_match(E_Config_Binding_Wheel *eb_in) (eb->z == eb_in->z) && (eb->modifiers == eb_in->modifiers) && (eb->any_mod == eb_in->any_mod) && - (!strcmp(eb->action, eb_in->action)) && - (!strcmp(eb->params, eb_in->params))) + (((eb->action) && (eb_in->action) && (!strcmp(eb->action, eb_in->action))) || + ((!eb->action) && (!eb_in->action))) && + (((eb->params) && (eb_in->params) && (!strcmp(eb->params, eb_in->params))) || + ((!eb->params) && (!eb_in->params)))) return eb; } return NULL; diff --git a/src/bin/e_intl.c b/src/bin/e_intl.c index 2609880..0b949c6 100644 --- a/src/bin/e_intl.c +++ b/src/bin/e_intl.c @@ -152,6 +152,7 @@ e_intl_language_set(const char *lang) { _e_intl_language = strdup(lang); e_util_env_set("LANGUAGE", _e_intl_language); + /* FIXME: maybe we should set these anyway? */ if (getenv("LANG")) e_util_env_set("LANG", _e_intl_language); if (getenv("LC_ALL")) e_util_env_set("LC_ALL", _e_intl_language); if (getenv("LC_MESSAGES")) e_util_env_set("LC_MESSAGES", _e_intl_language); -- 2.7.4