diff options
| author | Simon Tatham <anakin@pobox.com> | 2004-06-13 14:57:25 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2004-06-13 14:57:25 +0000 |
| commit | a7963e261b59522cf57696b07058da760fb22e2e (patch) | |
| tree | 7c53fc0df36973aa9142e0370774cbf3121fb5ff /error.c | |
| parent | 0c4ba28a316e3c9c48bf52db3d2081634a8e61f7 (diff) | |
| download | halibut-a7963e261b59522cf57696b07058da760fb22e2e.zip halibut-a7963e261b59522cf57696b07058da760fb22e2e.tar.gz halibut-a7963e261b59522cf57696b07058da760fb22e2e.tar.bz2 halibut-a7963e261b59522cf57696b07058da760fb22e2e.tar.xz | |
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]
Diffstat (limited to 'error.c')
| -rw-r--r-- | error.c | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -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 *); |