| 1351 | } |
| 1352 | |
| 1353 | int |
| 1354 | parse_cond_option(boolean negated, char *opts) |
| 1355 | { |
| 1356 | int i, sl; |
| 1357 | const char *compareto, *uniqpart, prefix[] = "cond_"; |
| 1358 | |
| 1359 | if (!opts || strlen(opts) <= sizeof prefix - 1) |
| 1360 | return 2; |
| 1361 | uniqpart = opts + (sizeof prefix - 1); |
| 1362 | for (i = 0; i < CONDITION_COUNT; ++i) { |
| 1363 | compareto = condtests[i].useroption; |
| 1364 | sl = Strlen(compareto); |
| 1365 | if (match_optname(uniqpart, compareto, (sl >= 4) ? 4 : sl, FALSE)) { |
| 1366 | condopt(i, &condtests[i].choice, negated); |
| 1367 | return 0; |
| 1368 | } |
| 1369 | } |
| 1370 | return 1; /* !0 indicates error */ |
| 1371 | } |
| 1372 | |
| 1373 | /* display a menu of all available status condition options and let player |
| 1374 | toggled them on or off; returns True iff any changes are made */ |
no test coverage detected