mirror of
https://github.com/rkd77/elinks.git
synced 2024-11-04 08:17:17 -05:00
SEE: Define the synthetic argv as an array.
This does not change the behaviour but perhaps makes the code clearer.
This commit is contained in:
parent
809fa053b6
commit
ea8f4b755d
@ -627,20 +627,20 @@ form_elems_get(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
SEE_SET_OBJECT(res, jsfe->namedItem);
|
||||
} else {
|
||||
unsigned char *string = see_string_to_unsigned_char(p);
|
||||
struct SEE_value argv;
|
||||
struct SEE_value *pargv = &argv;
|
||||
struct SEE_value arg0;
|
||||
struct SEE_value *argv[1] = { &arg0 };
|
||||
|
||||
if (!string) {
|
||||
SEE_SET_UNDEFINED(res);
|
||||
return;
|
||||
}
|
||||
SEE_SET_STRING(pargv, p);
|
||||
SEE_SET_STRING(&arg0, p);
|
||||
if (string[0] >= '0' && string[0] <= '9') {
|
||||
js_form_elems_item(interp, jsfe->item, o, 1,
|
||||
&pargv, res);
|
||||
argv, res);
|
||||
} else {
|
||||
js_form_elems_namedItem(interp, jsfe->namedItem, o, 1,
|
||||
&pargv, res);
|
||||
argv, res);
|
||||
}
|
||||
mem_free(string);
|
||||
}
|
||||
@ -748,18 +748,18 @@ forms_get(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
SEE_SET_OBJECT(res, fo->namedItem);
|
||||
} else {
|
||||
unsigned char *string = see_string_to_unsigned_char(p);
|
||||
struct SEE_value argv;
|
||||
struct SEE_value *argv1 = &argv;
|
||||
struct SEE_value arg0;
|
||||
struct SEE_value *argv[1] = { &arg0 };
|
||||
|
||||
if (!string) {
|
||||
SEE_SET_UNDEFINED(res);
|
||||
return;
|
||||
}
|
||||
SEE_SET_STRING(argv1, p);
|
||||
SEE_SET_STRING(&arg0, p);
|
||||
if (string[0] >= '0' && string[0] <= '9') {
|
||||
js_forms_item(interp, fo->item, o, 1, &argv1, res);
|
||||
js_forms_item(interp, fo->item, o, 1, argv, res);
|
||||
} else {
|
||||
js_forms_namedItem(interp, fo->namedItem, o, 1, &argv1, res);
|
||||
js_forms_namedItem(interp, fo->namedItem, o, 1, argv, res);
|
||||
}
|
||||
mem_free(string);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user