diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index cc4348a9d..b45e86c9a 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -2278,6 +2278,8 @@ throwing the silver bell (or other invocation item, or the Amulet) to the quest leader will identify it instead of being treated as an attack applying gold pieces will flip one and report "heads" or "tails"; with a stack of more than one, normally the flipped coin will rejoin the stack +during enlightenment and end-of-game disclosure, use contraction "n't" + for " not" Platform- and/or Interface-Specific New Features diff --git a/src/insight.c b/src/insight.c index e953c5903..0ddd235ca 100644 --- a/src/insight.c +++ b/src/insight.c @@ -127,12 +127,34 @@ enlght_out(const char *buf) } static void -enlght_line(const char *start, const char *middle, const char *end, - const char *ps) +enlght_line( + const char *start, + const char *middle, + const char *end, + const char *ps) { +#ifndef NO_ENLGHT_CONTRACTIONS + static const struct contrctn { + const char *twowords, *contrctn; + } contra[] = { + { " are not ", " aren't " }, + { " were not ", " weren't " }, + { " have not ", " haven't " }, + { " had not ", " hadn't " }, + { " can not ", " can't " }, + { " could not ", " couldn't " }, + }; + int i; +#endif char buf[BUFSZ]; Sprintf(buf, " %s%s%s%s.", start, middle, end, ps); +#ifndef NO_ENLGHT_CONTRACTIONS + if (strstri(buf, " not ")) { /* TODO: switch to libc strstr() */ + for (i = 0; i < SIZE(contra); ++i) + (void) strsubst(buf, contra[i].twowords, contra[i].contrctn); + } +#endif enlght_out(buf); }