From 81be17108bb5c54acc18609f9a1935f3f1c7ae66 Mon Sep 17 00:00:00 2001 From: Miciah Dashiel Butler Masters Date: Wed, 28 Dec 2005 07:12:09 +0000 Subject: [PATCH] Understand a boolean true from elinks.goto_url_hook and elinks.follow_url_hook to mean that the URI should be unchanged and that further hooks should be permitted to run. --- src/scripting/smjs/hooks.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/scripting/smjs/hooks.c b/src/scripting/smjs/hooks.c index 20902e0b8..91a768a41 100644 --- a/src/scripting/smjs/hooks.c +++ b/src/scripting/smjs/hooks.c @@ -34,9 +34,9 @@ script_hook_goto_url(va_list ap, void *data) if (JS_TRUE == smjs_invoke_elinks_object_method("goto_url_hook", args, 1, &rval)) { - if (JSVAL_IS_BOOLEAN(rval) - && JS_FALSE == JSVAL_TO_BOOLEAN(rval)) { - ret = EVENT_HOOK_STATUS_LAST; + if (JSVAL_IS_BOOLEAN(rval)) { + if (JS_FALSE == JSVAL_TO_BOOLEAN(rval)) + ret = EVENT_HOOK_STATUS_LAST; } else { JSString *jsstr = JS_ValueToString(smjs_ctx, rval); unsigned char *str = JS_GetStringBytes(jsstr); @@ -66,9 +66,9 @@ script_hook_follow_url(va_list ap, void *data) if (JS_TRUE == smjs_invoke_elinks_object_method("follow_url_hook", args, 1, &rval)) { - if (JSVAL_IS_BOOLEAN(rval) - && JS_FALSE == JSVAL_TO_BOOLEAN(rval)) { - ret = EVENT_HOOK_STATUS_LAST; + if (JSVAL_IS_BOOLEAN(rval)) { + if (JS_FALSE == JSVAL_TO_BOOLEAN(rval)) + ret = EVENT_HOOK_STATUS_LAST; } else { JSString *jsstr = JS_ValueToString(smjs_ctx, rval); unsigned char *str = JS_GetStringBytes(jsstr);