1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-07-01 02:05:33 +00: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:
Kalle Olavi Niemitalo 2007-05-27 18:53:31 +03:00 committed by Kalle Olavi Niemitalo
parent 9743729cb1
commit a38b22b356

View File

@ -618,20 +618,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);
}
@ -739,18 +739,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);
}