mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -05:00
elinks_goto_url(): Remove evil goto and simplify matters
This commit is contained in:
parent
ce2aa08cb1
commit
a08a3aca8f
@ -40,25 +40,20 @@ elinks_goto_url(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv,
|
||||
{
|
||||
unsigned char *url;
|
||||
|
||||
if (argc != 1)
|
||||
goto ret_false;
|
||||
if (argc != 1 || !smjs_ses) {
|
||||
*rval = JSVAL_FALSE;
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
url = jsval_to_string(ctx, &argv[0]);
|
||||
if (!*url)
|
||||
return JS_FALSE;
|
||||
|
||||
if (!smjs_ses)
|
||||
goto ret_false;
|
||||
|
||||
goto_url(smjs_ses, url);
|
||||
|
||||
*rval = JSVAL_TRUE;
|
||||
|
||||
return JS_TRUE;
|
||||
|
||||
ret_false:
|
||||
*rval = JSVAL_FALSE;
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user