summaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2004-04-10 08:59:19 +0000
committerSimon Tatham <anakin@pobox.com>2004-04-10 08:59:19 +0000
commitcb859ab83ed22a1b0dc9fd017cb0d68e0037d750 (patch)
tree1218ea2baf44c3ec3b312c3a6b2606e78fcce06c /error.c
parent221e2fcc83aa527bf515d40a754d69dc5793bb4f (diff)
downloadhalibut-cb859ab83ed22a1b0dc9fd017cb0d68e0037d750.zip
halibut-cb859ab83ed22a1b0dc9fd017cb0d68e0037d750.tar.gz
halibut-cb859ab83ed22a1b0dc9fd017cb0d68e0037d750.tar.bz2
halibut-cb859ab83ed22a1b0dc9fd017cb0d68e0037d750.tar.xz
Info backend now takes care to avoid magic characters in node names
and index terms (the Info format doesn't like them). In the course of this I've had to introduce some infrastructure for carrying a filepos forward from the definition of every RHS index term so that a particular backend can provide a usefully localised report of which index term had a problem. [originally from svn r4051]
Diffstat (limited to 'error.c')
-rw-r--r--error.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/error.c b/error.c
index efa0eb8..3bfa78b 100644
--- a/error.c
+++ b/error.c
@@ -16,6 +16,7 @@
static void do_error(int code, va_list ap) {
char error[1024];
char auxbuf[256];
+ char c;
char *sp, *sp2;
wchar_t *wsp;
filepos fpos, fpos2;
@@ -207,6 +208,19 @@ static void do_error(int code, va_list ap) {
" parameters");
flags = FILEPOS;
break;
+ case err_infoindexcolon:
+ fpos = *va_arg(ap, filepos *);
+ sprintf(error, "info output format does not support colons in"
+ " index terms; removing");
+ flags = FILEPOS;
+ break;
+ case err_infonodechar:
+ fpos = *va_arg(ap, filepos *);
+ c = (char)va_arg(ap, int);
+ sprintf(error, "info output format does not support '%c' in"
+ " node names; removing", c);
+ flags = FILEPOS;
+ break;
case err_whatever:
sp = va_arg(ap, char *);
vsprintf(error, sp, ap);