]> www.fi.muni.cz Git - evince.git/blobdiff - pdf/xpdf/Error.cc
Compiles at least :)
[evince.git] / pdf / xpdf / Error.cc
index cbb623ba33e1a51e45ad2ef54b35213639b0f739..0dc8150591d7afca559d4ea4bd66fbc3b5b03e07 100644 (file)
 // Send error messages to /dev/tty instead of stderr.
 GBool errorsToTTY = gFalse;
 
-// File to send error (and other) messages to.
 FILE *errFile;
+GBool errQuiet;
 
 void errorInit() {
-  if (!errorsToTTY || !(errFile = fopen("/dev/tty", "w")))
-    errFile = stderr;
+  if (errQuiet) {
+    errFile = NULL;
+  } else {
+    if (!errorsToTTY || !(errFile = fopen("/dev/tty", "w")))
+      errFile = stderr;
+  }
 }
 
 void CDECL error(int pos, char *msg, ...) {
   va_list args;
 
-  if (printCommands)
+  if (errQuiet) {
+    return;
+  }
+  if (printCommands) {
     fflush(stdout);
-  if (pos >= 0)
+  }
+  if (pos >= 0) {
     fprintf(errFile, "Error (%d): ", pos);
-  else
+  } else {
     fprintf(errFile, "Error: ");
+  }
   va_start(args, msg);
   vfprintf(errFile, msg, args);
   va_end(args);