summaryrefslogtreecommitdiff
path: root/editors/joe/patches/patch-ac
blob: 0bc1c8c26ed3b03a121d6190eaa5444da4d972ad (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
51
52
53
54
55
56
57
$NetBSD: patch-ac,v 1.4 2001/05/22 12:23:28 wiz Exp $

--- main.c.orig	Sun Jan 22 01:21:08 1995
+++ main.c
@@ -18,6 +18,10 @@
 
 #include <stdio.h>
 #include <fcntl.h>
+#if defined(__FreeBSD__) || defined(__NetBSD__)
+#include <locale.h>
+#include <ctype.h>
+#endif
 #include "config.h"
 #include "w.h"
 #include "tty.h"
@@ -187,6 +191,20 @@
  run=namprt(argv[0]);
 #endif 
 
+#if defined(__FreeBSD__) || defined(__NetBSD__)
+ setlocale(LC_ALL, "");
+ for(c=0;c<256;c++)
+  { int a=0;
+    if(iscntrl(c))
+     a|=UNDERLINE;
+    if((c&0x80)&&!isprint(c))
+     a|=INVERSE;
+    xlata[c]=a;
+    if(isprint(c))
+     xlatc[c]=c;
+  }
+#endif
+
  if(s=getenv("LINES")) sscanf(s,"%d",&lines);
  if(s=getenv("COLUMNS")) sscanf(s,"%d",&columns);
  if(s=getenv("BAUD")) sscanf(s,"%u",&Baud);
@@ -233,20 +251,6 @@
   }
 
 #else
-
- s=vsncpy(NULL,0,sc("."));
- s=vsncpy(sv(s),sv(run));
- s=vsncpy(sv(s),sc("rc"));
- c=procrc(cap,s);
- if(c==0) goto donerc;
- if(c==1)
-  {
-  char buf[8];
-  fprintf(stderr,"There were errors in '%s'.  Use it anyway?",s);
-  fflush(stderr);
-  fgets(buf,8,stdin);
-  if(buf[0]=='y' || buf[0]=='Y') goto donerc;
-  }
 
  vsrm(s);
  s=getenv("HOME");