| 348 | } |
| 349 | |
| 350 | static int conf_string(struct menu *menu) |
| 351 | { |
| 352 | struct symbol *sym = menu->sym; |
| 353 | const char *def; |
| 354 | |
| 355 | while (1) { |
| 356 | printf("%*s%s ", indent - 1, "", menu->prompt->text); |
| 357 | printf("(%s) ", sym->name); |
| 358 | def = sym_get_string_value(sym); |
| 359 | if (def) |
| 360 | printf("[%s] ", def); |
| 361 | if (!conf_askvalue(sym, def)) |
| 362 | return 0; |
| 363 | switch (line[0]) { |
| 364 | case '\n': |
| 365 | break; |
| 366 | case '?': |
| 367 | /* print help */ |
| 368 | if (line[1] == '\n') { |
| 369 | print_help(menu); |
| 370 | def = NULL; |
| 371 | break; |
| 372 | } |
| 373 | /* fall through */ |
| 374 | default: |
| 375 | line[strlen(line)-1] = 0; |
| 376 | def = line; |
| 377 | } |
| 378 | if (def && sym_set_string_value(sym, def)) |
| 379 | return 0; |
| 380 | } |
| 381 | } |
| 382 | |
| 383 | static int conf_sym(struct menu *menu) |
| 384 | { |
no test coverage detected