1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

SMJS: keymap_get_property: fix build error

Fix an error in the order of variable initialisation that was introduced
in commit bbf0d478e9.
This commit is contained in:
Kalle Olavi Niemitalo 2006-11-26 15:37:24 +02:00 committed by Kalle Olavi Niemitalo
parent 33ba13fcbc
commit d9604331b8

View File

@ -22,7 +22,6 @@ keymap_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
unsigned char *action_str;
const 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));