From cb859ab83ed22a1b0dc9fd017cb0d68e0037d750 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 10 Apr 2004 08:59:19 +0000 Subject: 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] --- error.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'error.c') 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); -- cgit v1.1