- struct ZOOM_options_entry *e;
-
- ZOOM_options_destroy (opt->parent1);
- ZOOM_options_destroy (opt->parent2);
- e = opt->entries;
- while (e)
- {
- struct ZOOM_options_entry *e0 = e;
- xfree (e->name);
- xfree (e->value);
- e = e->next;
- xfree (e0);
- }
- xfree (opt);
+ struct ZOOM_options_entry *e;
+
+ ZOOM_options_destroy (opt->parent1);
+ ZOOM_options_destroy (opt->parent2);
+ e = opt->entries;
+ while (e)
+ {
+ struct ZOOM_options_entry *e0 = e;
+ xfree (e->name);
+ xfree (e->value);
+ e = e->next;
+ xfree (e0);
+ }
+ xfree (opt);
+ }
+}
+
+/* PRIVATE to ZOOM_options_setl() */
+static void
+_set_value(struct ZOOM_options_entry **e, const char *value, int len)
+{
+ (*e)->value = 0;
+ (*e)->len = 0;
+ if (value)
+ {
+ (*e)->value = (char *) xmalloc (len+1);
+ memcpy ((*e)->value, value, len);
+ (*e)->value[len] = '\0';
+ (*e)->len = len;