From dd0d0505087f5a579e3f6839eb333f05500ad839 Mon Sep 17 00:00:00 2001 From: PatR Date: Sat, 21 Sep 2024 15:55:25 -0700 Subject: [PATCH] article 'a' for Angel names The recently revised priestname(), which is also used for angels since they share the " of " suffix, included a test for '!strncmp(,"Angel ",6)', assuming it was looking at the beginning of "Angel of ". But the " of " part doesn't get appended until later, so the test should be '!strcmp(,"Angel")' without the trailing space. Noticed by code inspection; I don't have a test case. Like priests, Angels are almost always referred to as "_the_ Angel of " so the bad "Angel " check normally wouldn't get reached. Also, fix an unrelated indentation bit in fixes3-7-0.txt. --- doc/fixes3-7-0.txt | 2 +- src/priest.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 07e627a95..013fa16c7 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -119,7 +119,7 @@ tribute (Discworld snippets) typos, in book order rather than fix order: #12 "or" -> "of", #14 second instance of "megalomaniac" misspelled Lords and Ladies passage #5, near end add missing opening double quote, passage #6 first footnote, insert omitted "be", passage #7 - last paragraph, "to" -> "be" + last paragraph, "to" -> "be" Men at Arms passage #1, italicize /for/, passage #2, insert omitted word "had": 'it was /fate/ that _had_ let Edward' Interesting Times passage #1, italicize several words diff --git a/src/priest.c b/src/priest.c index a46cc4078..8308a96e6 100644 --- a/src/priest.c +++ b/src/priest.c @@ -314,7 +314,8 @@ priestname( if (!mon->ispriest && !mon->isminion) /* should never happen... */ return strcpy(pname, what); /* caller must be confused */ - /* this was done near the end but we want 'what' to be updated sooner */ + /* for high priest(ess), "high" (or "grand" for poohbah) will be inserted + [this was done near the end but we want 'what' to be updated sooner] */ if (mon->ispriest || aligned_priest || high_priest) what = do_hallu ? "poohbah" : mon->female ? "priestess" : "priest"; @@ -324,8 +325,9 @@ priestname( article = ARTICLE_THE; if (article == ARTICLE_THE) { Strcpy(pname, "the "); - } else if (!strncmpi(what, "Angel ", 6)) { - /* bypass just_an(); it would yield "the " due to capital A */ + } else if (!strcmp(what, "Angel")) { + /* bypass just_an(); it would yield "" due to treating capital A + as indicating a personal name */ Strcpy(pname, "an "); } else { (void) just_an(pname, what);