1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-29 01:45:34 +00:00

[spidermonkey] Declare str earlier

This commit is contained in:
Witold Filipczyk 2023-09-12 15:41:42 +02:00
parent 80e2b6b812
commit 7cf2be2db7

View File

@ -867,6 +867,7 @@ document_get_property_referrer(JSContext *ctx, unsigned int argc, JS::Value *vp)
struct document_view *doc_view;
struct document *document;
struct session *ses;
char *str;
vs = interpreter->vs;
@ -893,7 +894,7 @@ document_get_property_referrer(JSContext *ctx, unsigned int argc, JS::Value *vp)
case REFERER_TRUE:
/* XXX: Encode as in add_url_to_httset_prop_string(&prop, ) ? --pasky */
if (ses->referrer) {
char *str = get_uri_string(ses->referrer, URI_HTTP_REFERRER);
str = get_uri_string(ses->referrer, URI_HTTP_REFERRER);
if (str) {
args.rval().setString(JS_NewStringCopyZ(ctx, str));
@ -905,7 +906,7 @@ document_get_property_referrer(JSContext *ctx, unsigned int argc, JS::Value *vp)
break;
case REFERER_SAME_URL:
char *str = get_uri_string(document->uri, URI_HTTP_REFERRER);
str = get_uri_string(document->uri, URI_HTTP_REFERRER);
if (str) {
args.rval().setString(JS_NewStringCopyZ(ctx, str));