Enlightenment CVS committal Author : raster Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_bg.c e_bindings.c e_config.c e_module.c Log Message: handle NULL config strings. some of them anyway =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_bg.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- e_bg.c 3 Nov 2005 06:17:07 -0000 1.11 +++ e_bg.c 23 Nov 2005 12:55:55 -0000 1.12 @@ -21,7 +21,7 @@ if (transition == E_BG_TRANSITION_START) trans = e_config->transition_start; else if (transition == E_BG_TRANSITION_DESK) trans = e_config->transition_desk; else if (transition == E_BG_TRANSITION_CHANGE) trans = e_config->transition_change; - if (strlen(trans) < 1) transition = E_BG_TRANSITION_NONE; + if ((!trans) || (strlen(trans) < 1)) transition = E_BG_TRANSITION_NONE; ok = 0; for (l = e_config->desktop_backgrounds; l; l = l->next) =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_bindings.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -3 -r1.26 -r1.27 --- e_bindings.c 11 Oct 2005 20:21:50 -0000 1.26 +++ e_bindings.c 23 Nov 2005 12:55:55 -0000 1.27 @@ -52,7 +52,8 @@ eb->any_mod, eb->action, eb->params); /* FIXME: Can this be solved in a generic way? */ /* FIXME: Only change cursor if action is allowed! */ - if ((!strcmp(eb->action, "window_resize")) && + if ((eb->action) && (eb->signal) && (eb->source) && + (!strcmp(eb->action, "window_resize")) && (!strncmp(eb->signal, "mouse,down,", 11)) && (!strncmp(eb->source, "resize_", 7))) { @@ -125,8 +126,8 @@ bind->button = button; bind->mod = mod; bind->any_mod = any_mod; - bind->action = strdup(action); - bind->params = strdup(params); + if (action) bind->action = strdup(action); + if (params) bind->params = strdup(params); mouse_bindings = evas_list_append(mouse_bindings, bind); } @@ -144,8 +145,10 @@ (bind->button == button) && (bind->mod == mod) && (bind->any_mod == any_mod) && - (!strcmp(bind->action, action)) && - (!strcmp(bind->params, params))) + (((bind->action) && (action) && (!strcmp(bind->action, action))) || + ((!bind->action) && (!action))) && + (((bind->params) && (params) && (!strcmp(bind->params, params))) || + ((!bind->params) && (!params)))) { _e_bindings_mouse_free(bind); mouse_bindings = evas_list_remove_list(mouse_bindings, l); @@ -315,8 +318,8 @@ bind->key = strdup(key); bind->mod = mod; bind->any_mod = any_mod; - bind->action = strdup(action); - bind->params = strdup(params); + if (action) bind->action = strdup(action); + if (params) bind->params = strdup(params); key_bindings = evas_list_append(key_bindings, bind); } @@ -331,11 +334,13 @@ bind = l->data; if ((bind->ctxt == ctxt) && - (!strcmp(bind->key, key)) && + (key) && (bind->key) && (!strcmp(bind->key, key)) && (bind->mod == mod) && (bind->any_mod == any_mod) && - (!strcmp(bind->action, action)) && - (!strcmp(bind->params, params))) + (((bind->action) && (action) && (!strcmp(bind->action, action))) || + ((!bind->action) && (!action))) && + (((bind->params) && (params) && (!strcmp(bind->params, params))) || + ((!bind->params) && (!params)))) { _e_bindings_key_free(bind); key_bindings = evas_list_remove_list(key_bindings, l); @@ -409,7 +414,7 @@ E_Binding_Key *bind; bind = l->data; - if ((!strcmp(bind->key, ev->keyname)) && + if ((bind->key) && (!strcmp(bind->key, ev->keyname)) && ((bind->any_mod) || (bind->mod == mod))) { if (_e_bindings_context_match(bind->ctxt, ctxt)) @@ -447,7 +452,7 @@ E_Binding_Key *bind; bind = l->data; - if ((!strcmp(bind->key, ev->keyname)) && + if ((bind->key) && (!strcmp(bind->key, ev->keyname)) && ((bind->any_mod) || (bind->mod == mod))) { if (_e_bindings_context_match(bind->ctxt, ctxt)) @@ -478,12 +483,12 @@ bind = calloc(1, sizeof(E_Binding_Signal)); bind->ctxt = ctxt; - bind->sig = strdup(sig); - bind->src = strdup(src); + if (sig) bind->sig = strdup(sig); + if (src) bind->src = strdup(src); bind->mod = mod; bind->any_mod = any_mod; - bind->action = strdup(action); - bind->params = strdup(params); + if (action) bind->action = strdup(action); + if (params) bind->params = strdup(params); signal_bindings = evas_list_append(signal_bindings, bind); } @@ -498,12 +503,16 @@ bind = l->data; if ((bind->ctxt == ctxt) && - (!strcmp(bind->sig, sig)) && - (!strcmp(bind->src, src)) && + (((bind->sig) && (sig) && (!strcmp(bind->sig, sig))) || + ((!bind->sig) && (!sig))) && + (((bind->src) && (src) && (!strcmp(bind->src, src))) || + ((!bind->src) && (!src))) && (bind->mod == mod) && (bind->any_mod == any_mod) && - (!strcmp(bind->action, action)) && - (!strcmp(bind->params, params))) + (((bind->action) && (action) && (!strcmp(bind->action, action))) || + ((!bind->action) && (!action))) && + (((bind->params) && (params) && (!strcmp(bind->params, params))) || + ((!bind->params) && (!params)))) { _e_bindings_signal_free(bind); signal_bindings = evas_list_remove_list(signal_bindings, l); @@ -549,7 +558,9 @@ { E_Action *act; E_Binding_Signal *bind; - + + if (sig[0] == 0) sig = NULL; + if (src[0] == 0) src = NULL; act = e_bindings_signal_find(ctxt, obj, sig, src, &bind); if (act) { @@ -574,8 +585,8 @@ bind->z = z; bind->mod = mod; bind->any_mod = any_mod; - bind->action = strdup(action); - bind->params = strdup(params); + if (action) bind->action = strdup(action); + if (params) bind->params = strdup(params); wheel_bindings = evas_list_append(wheel_bindings, bind); } @@ -594,8 +605,10 @@ (bind->z == z) && (bind->mod == mod) && (bind->any_mod == any_mod) && - (!strcmp(bind->action, action)) && - (!strcmp(bind->params, params))) + (((bind->action) && (action) && (!strcmp(bind->action, action))) || + ((!bind->action) && (!action))) && + (((bind->params) && (params) && (!strcmp(bind->params, params))) || + ((!bind->params) && (!params)))) { _e_bindings_wheel_free(bind); wheel_bindings = evas_list_remove_list(wheel_bindings, l); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_config.c,v retrieving revision 1.123 retrieving revision 1.124 diff -u -3 -r1.123 -r1.124 --- e_config.c 22 Nov 2005 13:28:10 -0000 1.123 +++ e_config.c 23 Nov 2005 12:55:55 -0000 1.124 @@ -400,7 +400,7 @@ e_config = E_NEW(E_Config, 1); e_config->config_version = E_CONFIG_FILE_VERSION; e_config->show_splash = 1; - e_config->desktop_default_background = strdup(""); + e_config->desktop_default_background = NULL; e_config->desktop_default_name = strdup("Desktop %i, %i"); e_config->menus_scroll_speed = 1000.0; e_config->menus_fast_mouse_move_threshhold = 300.0; @@ -426,7 +426,7 @@ e_config->evas_engine_drag = E_EVAS_ENGINE_DEFAULT; e_config->evas_engine_win = E_EVAS_ENGINE_DEFAULT; e_config->evas_engine_zone = E_EVAS_ENGINE_DEFAULT; - e_config->language = strdup(""); + e_config->language = NULL; e_config->window_placement_policy = E_WINDOW_PLACEMENT_SMART; e_config->focus_policy = E_FOCUS_SLOPPY; e_config->focus_setting = E_FOCUS_NEW_DIALOG_IF_OWNER_FOCUSED; @@ -466,7 +466,7 @@ e_config->kill_timer_wait = 10.0; e_config->ping_clients = 1; e_config->ping_clients_wait = 10.0; - e_config->transition_start = strdup(""); + e_config->transition_start = NULL; e_config->transition_desk = strdup("vswipe"); e_config->transition_change = strdup("crossfade"); e_config->move_info_follows = 1; @@ -589,7 +589,7 @@ eb->modifiers = E_BINDING_MODIFIER_ALT; eb->any_mod = 0; eb->action = strdup("window_move"); - eb->params = strdup(""); + eb->params = NULL; e_config->mouse_bindings = evas_list_append(e_config->mouse_bindings, eb); eb = E_NEW(E_Config_Binding_Mouse, 1); @@ -598,7 +598,7 @@ eb->modifiers = E_BINDING_MODIFIER_ALT; eb->any_mod = 0; eb->action = strdup("window_resize"); - eb->params = strdup(""); + eb->params = NULL; e_config->mouse_bindings = evas_list_append(e_config->mouse_bindings, eb); eb = E_NEW(E_Config_Binding_Mouse, 1); @@ -607,7 +607,7 @@ eb->modifiers = E_BINDING_MODIFIER_ALT; eb->any_mod = 0; eb->action = strdup("window_menu"); - eb->params = strdup(""); + eb->params = NULL; e_config->mouse_bindings = evas_list_append(e_config->mouse_bindings, eb); eb = E_NEW(E_Config_Binding_Mouse, 1); @@ -643,7 +643,7 @@ eb->modifiers = E_BINDING_MODIFIER_ALT; eb->any_mod = 0; eb->action = strdup("edit_mode"); - eb->params = strdup(""); + eb->params = NULL; e_config->mouse_bindings = evas_list_append(e_config->mouse_bindings, eb); } { @@ -691,7 +691,7 @@ eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT; eb->any_mod = 0; eb->action = strdup("window_raise"); - eb->params = strdup(""); + eb->params = NULL; e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); eb = E_NEW(E_Config_Binding_Key, 1); @@ -700,7 +700,7 @@ eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT; eb->any_mod = 0; eb->action = strdup("window_lower"); - eb->params = strdup(""); + eb->params = NULL; e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); eb = E_NEW(E_Config_Binding_Key, 1); @@ -709,7 +709,7 @@ eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT; eb->any_mod = 0; eb->action = strdup("window_close"); - eb->params = strdup(""); + eb->params = NULL; e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); eb = E_NEW(E_Config_Binding_Key, 1); @@ -718,7 +718,7 @@ eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT; eb->any_mod = 0; eb->action = strdup("window_kill"); - eb->params = strdup(""); + eb->params = NULL; e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); eb = E_NEW(E_Config_Binding_Key, 1); @@ -727,7 +727,7 @@ eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT; eb->any_mod = 0; eb->action = strdup("window_menu"); - eb->params = strdup(""); + eb->params = NULL; e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); eb = E_NEW(E_Config_Binding_Key, 1); @@ -736,7 +736,7 @@ eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT; eb->any_mod = 0; eb->action = strdup("window_sticky_toggle"); - eb->params = strdup(""); + eb->params = NULL; e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); eb = E_NEW(E_Config_Binding_Key, 1); @@ -745,7 +745,7 @@ eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT; eb->any_mod = 0; eb->action = strdup("window_iconic_toggle"); - eb->params = strdup(""); + eb->params = NULL; e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); eb = E_NEW(E_Config_Binding_Key, 1); @@ -754,7 +754,7 @@ eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT; eb->any_mod = 0; eb->action = strdup("window_maximized_toggle"); - eb->params = strdup(""); + eb->params = NULL; e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); eb = E_NEW(E_Config_Binding_Key, 1); @@ -763,7 +763,7 @@ eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT; eb->any_mod = 0; eb->action = strdup("window_shaded_toggle"); - eb->params = strdup(""); + eb->params = NULL; e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); eb = E_NEW(E_Config_Binding_Key, 1); @@ -970,7 +970,7 @@ eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT; eb->any_mod = 0; eb->action = strdup("edit_mode_toggle"); - eb->params = strdup(""); + eb->params = NULL; e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); eb = E_NEW(E_Config_Binding_Key, 1); @@ -979,7 +979,7 @@ eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT; eb->any_mod = 0; eb->action = strdup("restart"); - eb->params = strdup(""); + eb->params = NULL; e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); eb = E_NEW(E_Config_Binding_Key, 1); @@ -988,7 +988,7 @@ eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT; eb->any_mod = 0; eb->action = strdup("exit"); - eb->params = strdup(""); + eb->params = NULL; e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); /* need to support fullscreen anyway for this - ie netwm and the border @@ -1046,7 +1046,7 @@ eb->modifiers = E_BINDING_MODIFIER_NONE; eb->any_mod = 1; eb->action = strdup("window_menu"); - eb->params = strdup(""); + eb->params = NULL; e_config->signal_bindings = evas_list_append(e_config->signal_bindings, eb); eb = E_NEW(E_Config_Binding_Signal, 1); @@ -1056,7 +1056,7 @@ eb->modifiers = E_BINDING_MODIFIER_NONE; eb->any_mod = 1; eb->action = strdup("window_menu"); - eb->params = strdup(""); + eb->params = NULL; e_config->signal_bindings = evas_list_append(e_config->signal_bindings, eb); eb = E_NEW(E_Config_Binding_Signal, 1); @@ -1066,7 +1066,7 @@ eb->modifiers = E_BINDING_MODIFIER_NONE; eb->any_mod = 1; eb->action = strdup("window_close"); - eb->params = strdup(""); + eb->params = NULL; e_config->signal_bindings = evas_list_append(e_config->signal_bindings, eb); eb = E_NEW(E_Config_Binding_Signal, 1); @@ -1076,7 +1076,7 @@ eb->modifiers = E_BINDING_MODIFIER_NONE; eb->any_mod = 1; eb->action = strdup("window_kill"); - eb->params = strdup(""); + eb->params = NULL; e_config->signal_bindings = evas_list_append(e_config->signal_bindings, eb); eb = E_NEW(E_Config_Binding_Signal, 1); @@ -1086,7 +1086,7 @@ eb->modifiers = E_BINDING_MODIFIER_NONE; eb->any_mod = 1; eb->action = strdup("window_maximized_toggle"); - eb->params = strdup(""); + eb->params = NULL; e_config->signal_bindings = evas_list_append(e_config->signal_bindings, eb); eb = E_NEW(E_Config_Binding_Signal, 1); @@ -1116,7 +1116,7 @@ eb->modifiers = E_BINDING_MODIFIER_NONE; eb->any_mod = 1; eb->action = strdup("window_iconic_toggle"); - eb->params = strdup(""); + eb->params = NULL; e_config->signal_bindings = evas_list_append(e_config->signal_bindings, eb); eb = E_NEW(E_Config_Binding_Signal, 1); @@ -1126,7 +1126,7 @@ eb->modifiers = E_BINDING_MODIFIER_NONE; eb->any_mod = 1; eb->action = strdup("window_drag_icon"); - eb->params = strdup(""); + eb->params = NULL; e_config->signal_bindings = evas_list_append(e_config->signal_bindings, eb); eb = E_NEW(E_Config_Binding_Signal, 1); @@ -1136,7 +1136,7 @@ eb->modifiers = E_BINDING_MODIFIER_NONE; eb->any_mod = 1; eb->action = strdup("window_move"); - eb->params = strdup(""); + eb->params = NULL; e_config->signal_bindings = evas_list_append(e_config->signal_bindings, eb); eb = E_NEW(E_Config_Binding_Signal, 1); @@ -1246,7 +1246,7 @@ eb->modifiers = E_BINDING_MODIFIER_NONE; eb->any_mod = 1; eb->action = strdup("window_move"); - eb->params = strdup(""); + eb->params = NULL; e_config->signal_bindings = evas_list_append(e_config->signal_bindings, eb); eb = E_NEW(E_Config_Binding_Signal, 1); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_module.c,v retrieving revision 1.45 retrieving revision 1.46 diff -u -3 -r1.45 -r1.46 --- e_module.c 1 Nov 2005 02:44:08 -0000 1.45 +++ e_module.c 23 Nov 2005 12:55:55 -0000 1.46 @@ -48,7 +48,8 @@ em = l->data; pl = l; l = l->next; - m = e_module_new(em->name); + m = NULL; + if (em->name) m = e_module_new(em->name); if (m) { if (em->enabled) e_module_enable(m); ------------------------------------------------------- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today Register for a JBoss Training Course. Free Certification Exam for All Training Attendees Through End of 2005. For more info visit: http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs