More directly describes the only thing it does.
Showing the changes to scripts (1 of 1 file). Show all
Unified · Split
| @@ -79,19 +79,23 @@ void menu_end_menu(void) · 78 unmodified lines | ||
| 79 | 79 | current_menu = current_menu->parent; |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | −static struct expr *menu_check_dep(struct expr *e) | |
| 82 | +/* | |
| 83 | + * Rewrites 'm' to 'm' && MODULES, so that it evaluates to 'n' when running | |
| 84 | + * without modules | |
| 85 | + */ | |
| 86 | +static struct expr *rewrite_m(struct expr *e) | |
| 83 | 87 | { |
| 84 | 88 | if (!e) |
| 85 | 89 | return e; |
| 86 | 90 | |
| 87 | 91 | switch (e->type) { |
| 88 | 92 | case E_NOT: |
| 89 | − e->left.expr = menu_check_dep(e->left.expr); | |
| 93 | + e->left.expr = rewrite_m(e->left.expr); | |
| 90 | 94 | break; |
| 91 | 95 | case E_OR: |
| 92 | 96 | case E_AND: |
| 93 | − e->left.expr = menu_check_dep(e->left.expr); | |
| 94 | − e->right.expr = menu_check_dep(e->right.expr); | |
| 97 | + e->left.expr = rewrite_m(e->left.expr); | |
| 98 | + e->right.expr = rewrite_m(e->right.expr); | |
| 95 | 99 | break; |
| 96 | 100 | case E_SYMBOL: |
| 97 | 101 | /* change 'm' into 'm' && MODULES */ |
| @@ -106,7 +110,7 @@ static struct expr *menu_check_dep(struct expr *e) · 8 unmodified lines | ||
| 106 | 110 | |
| 107 | 111 | void menu_add_dep(struct expr *dep) |
| 108 | 112 | { |
| 109 | − current_entry->dep = expr_alloc_and(current_entry->dep, menu_check_dep(dep)); | |
| 113 | + current_entry->dep = expr_alloc_and(current_entry->dep, rewrite_m(dep)); | |
| 110 | 114 | } |
| 111 | 115 | |
| 112 | 116 | void menu_set_type(int type) |
| @@ -131,7 +135,7 @@ static struct property *menu_add_prop(enum prop_type type, char *prompt, struct · 18 unmodified lines | ||
| 131 | 135 | |
| 132 | 136 | prop->menu = current_entry; |
| 133 | 137 | prop->expr = expr; |
| 134 | − prop->visible.expr = menu_check_dep(dep); | |
| 138 | + prop->visible.expr = rewrite_m(dep); | |
| 135 | 139 | |
| 136 | 140 | if (prompt) { |
| 137 | 141 | if (isspace(*prompt)) { |