| 371 | } |
| 372 | |
| 373 | int |
| 374 | match_str2attr(const char *str, boolean complain) |
| 375 | { |
| 376 | int i, a = -1; |
| 377 | |
| 378 | for (i = 0; i < SIZE(attrnames); i++) |
| 379 | if (attrnames[i].name |
| 380 | && fuzzymatch(str, attrnames[i].name, " -_", TRUE)) { |
| 381 | a = attrnames[i].attr; |
| 382 | break; |
| 383 | } |
| 384 | |
| 385 | if (a == -1 && complain) |
| 386 | config_error_add("Unknown text attribute '%.50s'", str); |
| 387 | |
| 388 | return a; |
| 389 | } |
| 390 | |
| 391 | /* ask about highlighting attribute; for menu headers and menu |
| 392 | coloring patterns, only one attribute at a time is allowed; |
no test coverage detected