From f2854e19ba490e926c957dfa1f1dd7d605c1e41f Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Sun, 26 Nov 2006 15:37:24 +0200 Subject: [PATCH] SMJS: keymap_get_property: fix build error Fix an error in the order of variable initialisation that was introduced in commit 9a829b3277474d48a55875fb5ea86755981e964b. (Copied from a2c48b4d91fe6c6998836deca73eb93d324630df in ELinks 0.12.GIT.) --- src/scripting/smjs/keybinding.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scripting/smjs/keybinding.c b/src/scripting/smjs/keybinding.c index f66713a93..54546a36a 100644 --- a/src/scripting/smjs/keybinding.c +++ b/src/scripting/smjs/keybinding.c @@ -22,7 +22,6 @@ keymap_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp) unsigned char *action_str; unsigned char *keystroke_str; int *data; - enum keymap_id keymap_id = *data; assert(JS_InstanceOf(ctx, obj, (JSClass *) &keymap_class, NULL)); if_assert_failed return JS_FALSE; @@ -32,7 +31,8 @@ keymap_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp) keystroke_str = JS_GetStringBytes(JS_ValueToString(ctx, id)); if (!keystroke_str) goto ret_null; - action_str = get_action_name_from_keystroke(keymap_id, keystroke_str); + action_str = get_action_name_from_keystroke((enum keymap_id) *data, + keystroke_str); if (!action_str) goto ret_null; *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(ctx, action_str));