- } else if (strcmp(firstword, "map") == 0) {
- if (currmap->max_mappings == currmap->n_mappings) {
- currmap->max_mappings = currmap->max_mappings * 2 + 1;
- currmap->mapping = xrealloc(currmap->mapping, sizeof(char *) * currmap->max_mappings);
+ if (!currif->option[currif->n_options].value) {
+ perror(filename);
+ return NULL;
+ }
+ debug_noise("\t%s=%s\n", currif->option[currif->n_options].name,
+ currif->option[currif->n_options].value);
+ currif->n_options++;
+ break;
+ case MAPPING:
+#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
+ if (strcmp(firstword, "script") == 0) {
+ if (currmap->script != NULL) {
+ bb_error_msg("duplicate script in mapping \"%s\"", buf);
+ return NULL;
+ } else {
+ currmap->script = bb_xstrdup(next_word(&buf_ptr));
+ }
+ } else if (strcmp(firstword, "map") == 0) {
+ if (currmap->max_mappings == currmap->n_mappings) {
+ currmap->max_mappings = currmap->max_mappings * 2 + 1;
+ currmap->mapping = xrealloc(currmap->mapping, sizeof(char *) * currmap->max_mappings);
+ }
+ currmap->mapping[currmap->n_mappings] = bb_xstrdup(next_word(&buf_ptr));
+ currmap->n_mappings++;
+ } else {
+ bb_error_msg("misplaced option \"%s\"", buf);
+ return NULL;