1
0
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:
Kalle Olavi Niemitalo 2007-05-27 18:53:31 +03:00 committed by Witold Filipczyk
parent 809fa053b6
commit ea8f4b755d

View File

@ -627,20 +627,20 @@ form_elems_get(struct SEE_interpreter *interp, struct SEE_object *o,
SEE_SET_OBJECT(res, jsfe->namedItem); SEE_SET_OBJECT(res, jsfe->namedItem);
} else { } else {
unsigned char *string = see_string_to_unsigned_char(p); unsigned char *string = see_string_to_unsigned_char(p);
struct SEE_value argv; struct SEE_value arg0;
struct SEE_value *pargv = &argv; struct SEE_value *argv[1] = { &arg0 };
if (!string) { if (!string) {
SEE_SET_UNDEFINED(res); SEE_SET_UNDEFINED(res);
return; return;
} }
SEE_SET_STRING(pargv, p); SEE_SET_STRING(&arg0, p);
if (string[0] >= '0' && string[0] <= '9') { if (string[0] >= '0' && string[0] <= '9') {
js_form_elems_item(interp, jsfe->item, o, 1, js_form_elems_item(interp, jsfe->item, o, 1,
&pargv, res); argv, res);
} else { } else {
js_form_elems_namedItem(interp, jsfe->namedItem, o, 1, js_form_elems_namedItem(interp, jsfe->namedItem, o, 1,
&pargv, res); argv, res);
} }
mem_free(string); mem_free(string);
} }
@ -748,18 +748,18 @@ forms_get(struct SEE_interpreter *interp, struct SEE_object *o,
SEE_SET_OBJECT(res, fo->namedItem); SEE_SET_OBJECT(res, fo->namedItem);
} else { } else {
unsigned char *string = see_string_to_unsigned_char(p); unsigned char *string = see_string_to_unsigned_char(p);
struct SEE_value argv; struct SEE_value arg0;
struct SEE_value *argv1 = &argv; struct SEE_value *argv[1] = { &arg0 };
if (!string) { if (!string) {
SEE_SET_UNDEFINED(res); SEE_SET_UNDEFINED(res);
return; return;
} }
SEE_SET_STRING(argv1, p); SEE_SET_STRING(&arg0, p);
if (string[0] >= '0' && string[0] <= '9') { 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 { } else {
js_forms_namedItem(interp, fo->namedItem, o, 1, &argv1, res); js_forms_namedItem(interp, fo->namedItem, o, 1, argv, res);
} }
mem_free(string); mem_free(string);
} }