check 'str' for an article prefix and return length of that */
| 261 | |
| 262 | /* check 'str' for an article prefix and return length of that */ |
| 263 | static unsigned |
| 264 | pi_article_skip(const char *str) |
| 265 | { |
| 266 | unsigned skip = 0; /* number of chars to skip when displaying str */ |
| 267 | |
| 268 | /* |
| 269 | * if (!strncmp(str, "a ", 2)) |
| 270 | * skip = 2; |
| 271 | * else if (!strncmp(str, "an ", 3)) |
| 272 | * skip = 3; |
| 273 | * else if (!strncmp(str, "the ", 4)) |
| 274 | * skip = 4; |
| 275 | */ |
| 276 | if (str[0] == 'a') { |
| 277 | if (str[1] == ' ') |
| 278 | skip = 2; |
| 279 | else if (str[1] == 'n' && str[2] == ' ') |
| 280 | skip = 3; |
| 281 | } else if (str[0] == 't') { |
| 282 | if (str[1] == 'h' && str[2] == 'e' && str[3] == ' ') |
| 283 | skip = 4; |
| 284 | } |
| 285 | |
| 286 | return skip; |
| 287 | } |
| 288 | |
| 289 | /* store an inventory item or class header but don't display anything yet */ |
| 290 | void |
no outgoing calls
no test coverage detected