used by safe_qbuf() if the full doname() result is too long */
| 5420 | |
| 5421 | /* used by safe_qbuf() if the full doname() result is too long */ |
| 5422 | staticfn char * |
| 5423 | cinv_ansimpleoname(struct obj *obj) |
| 5424 | { |
| 5425 | char *result = ansimpleoname(obj); |
| 5426 | |
| 5427 | /* result is an obuf[] so we know this will always fit */ |
| 5428 | if (obj->otrapped) { |
| 5429 | if (strncmp(result, "a ", 2)) |
| 5430 | (void) strsubst(result, "a ", "a trapped "); |
| 5431 | else if (strncmp(result, "an ", 3)) |
| 5432 | (void) strsubst(result, "an ", "an trapped "); |
| 5433 | /* unique container? nethack doesn't have any */ |
| 5434 | else if (strncmp(result, "the ", 4)) |
| 5435 | (void) strsubst(result, "the ", "the trapped "); |
| 5436 | /* no leading article at all? shouldn't happen with ansimpleoname() */ |
| 5437 | else |
| 5438 | (void) strsubst(result, "", "trapped "); /* insert at beginning */ |
| 5439 | } |
| 5440 | return result; |
| 5441 | } |
| 5442 | |
| 5443 | /* Display the contents of a container in inventory style. |
| 5444 | Used for wand of probing of non-empty containers and statues. */ |
nothing calls this directly
no test coverage detected