MCPcopy Create free account
hub / github.com/NetHack/NetHack / opt_out_words

Function opt_out_words

src/mdlib.c:640–666  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

638#endif
639
640staticfn void
641opt_out_words(
642 char *str, /* input, but modified during processing */
643 int *length_p) /* in/out */
644{
645 char *word;
646
647 while (*str) {
648 word = strchr(str, ' ');
649#if 0
650 /* treat " (" as unbreakable space */
651 if (word && *(word + 1) == '(')
652 word = strchr(word + 1, ' ');
653#endif
654 if (word)
655 *word = '\0';
656 if (*length_p + (int) strlen(str) > COLNO - 5) {
657 STOREOPTTEXT(optbuf);
658 Sprintf(optbuf, "%s", opt_indent),
659 *length_p = (int) strlen(opt_indent);
660 } else {
661 Sprintf(eos(optbuf), " "), (*length_p)++;
662 }
663 Sprintf(eos(optbuf), "%s", str), *length_p += (int) strlen(str);
664 str += strlen(str) + (word ? 1 : 0);
665 }
666}
667
668staticfn void
669build_options(void)

Callers 1

build_optionsFunction · 0.85

Calls 1

eosFunction · 0.85

Tested by

no test coverage detected