From a7963e261b59522cf57696b07058da760fb22e2e Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 13 Jun 2004 14:57:25 +0000 Subject: The Halibut manual contained at least one instance of two index terms (intentionally) differing only in case, which were being silently folded into one by the case-insensitive index tag comparison. Halibut now warns in this situation (but then folds them anyway, which I think is better than silently generating an index containing many case-distinct forms of the same word - I imagine it's very easy to do that by mistake). The manual has been fixed to explicitly define distinct keywords (in the case I spotted and in five other cases picked up by the new warning!), and also documents this issue and how to work with it. [originally from svn r4279] --- error.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'error.c') diff --git a/error.c b/error.c index 350e71a..879d081 100644 --- a/error.c +++ b/error.c @@ -18,7 +18,7 @@ static void do_error(int code, va_list ap) { char c; int i, j; char *sp, *sp2; - wchar_t *wsp; + wchar_t *wsp, *wsp2; filepos fpos, fpos2; int flags; @@ -142,6 +142,20 @@ static void do_error(int code, va_list ap) { sprintf(error, "unable to nest index markings"); flags = FILEPOS; break; + case err_indexcase: + fpos = *va_arg(ap, filepos *); + wsp = va_arg(ap, wchar_t *); + sp = utoa_locale_dup(wsp); + fpos2 = *va_arg(ap, filepos *); + wsp2 = va_arg(ap, wchar_t *); + sp2 = utoa_locale_dup(wsp2); + sprintf(error, "warning: index tag `%.200s' used with ", sp); + sprintf(error + strlen(error), "different case (`%.200s') at %s:%d", + sp2, fpos2.filename, fpos2.line); + flags = FILEPOS; + sfree(sp); + sfree(sp2); + break; case err_nosuchkw: fpos = *va_arg(ap, filepos *); wsp = va_arg(ap, wchar_t *); -- cgit v1.1