summaryrefslogtreecommitdiff
path: root/mail/faces/patches/patch-af
blob: cf7e468ec965b96d484d02cb0eda1ecff748e7c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
$NetBSD: patch-af,v 1.7 2006/01/08 14:30:01 tron Exp $

--- compface/uncmain.c.orig	1991-10-24 03:28:07.000000000 +0100
+++ compface/uncmain.c	2006-01-08 14:24:41.000000000 +0000
@@ -18,6 +18,8 @@
 #include <fcntl.h>
 #include "compface.h"
 
+extern int xbitmap;
+
 /* the buffer is longer than needed to handle sparse input formats */
 #define FACEBUFLEN 2048
 char fbuf[FACEBUFLEN];
@@ -33,12 +35,21 @@
 
 /* error handling definitions follow */
 
-extern int errno, sys_nerr;
+#include <errno.h>
+#include <stdio.h>
+
+#if !defined(__NetBSD__) && !defined(__INTERIX) && !defined(__DragonFly__) && !defined(__FreeBSD__) && !defined(__APPLE__)
+extern int sys_nerr;
 extern char *sys_errlist[];
+#endif
 
 extern void exit P((int)) ;
 
+#ifdef __INTERIX
+#define ERR strerror(errno)
+#else
 #define ERR ((errno < sys_nerr) ? sys_errlist[errno] : "")
+#endif
 #define INITERR(s) {(void)strcpy(fbuf, cmdname); (void)strcat(fbuf, ": ");\
 					(void)strcat(fbuf, (s));}
 #define ADDERR(s) (void)strcat(fbuf, (s));
@@ -60,6 +71,13 @@
     if (*((*argv)++) == '/')
       cmdname = *argv;               /* find the command's basename */
 
+  if (argc > 1 && !strcmp(argv[1], "-X"))
+    {
+      xbitmap++;
+      argc--;
+      argv++;
+    }
+
   if (argc > 3)
     {
       INITERR("usage: ")