Include libcharset into both the Timber and Halibut checkouts.
[sgt/halibut] / error.c
diff --git a/error.c b/error.c
index bf16504..5f5cbda 100644 (file)
--- 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;
@@ -200,7 +201,20 @@ static void do_error(int code, va_list ap) {
        sprintf(error, "section headings are not supported within \\%.100s",
                sp);
        flags = FILEPOS;
-       break; 
+       break;
+      case err_infodirentry:
+       fpos = *va_arg(ap, filepos *);
+       sprintf(error, "\\cfg{info-dir-entry} expects at least three"
+               " parameters");
+       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);
@@ -211,7 +225,9 @@ static void do_error(int code, va_list ap) {
     if (flags & PREFIX)
        fputs("halibut: ", stderr);
     if (flags & FILEPOS) {
-       fprintf(stderr, "%s:%d:", fpos.filename, fpos.line);
+       fprintf(stderr, "%s:", fpos.filename);
+       if (fpos.line > 0)
+           fprintf(stderr, "%d:", fpos.line);
        if (fpos.col > 0)
            fprintf(stderr, "%d:", fpos.col);
        fputc(' ', stderr);