summaryrefslogtreecommitdiff
blob: 2acf25bd8f0a4b137df16c10813befa7af35ac1d (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
Written by Robin H. Johnson <robbat2@gentoo.org>.

This patch is meant as additional to the FreeBSD patches aa-ad.
1. Cleans up the Makefile so that it is properly parallel.
2. Makefile now tracks errors correctly (piped errors are lost to Make).
3. Fixes bugs in the code that caused glibc's corruption detection to trigger.
4. Fixes code so it should mostly compile on gcc4.

diff -Nuar kcfonts-1.05.orig/Makefile kcfonts-1.05/Makefile
--- kcfonts-1.05.orig/Makefile	2006-01-11 16:33:36.976771750 -0800
+++ kcfonts-1.05/Makefile	2006-01-11 16:32:31.416674500 -0800
@@ -16,20 +16,25 @@
 
 all:	$(FONTS)
 
-kc24f.pcf.gz:	kc24f 
-	./kc24f | bdftopcf | gzip - > kc24f.pcf.gz 
-kc15f.pcf.gz:	kc15f
-	./kc15f | bdftopcf | gzip - > kc15f.pcf.gz 
-kc8x15.pcf.gz:	kca2et kc8x15
+.SECONDARY: $(FONTS:.pcf.gz=.pcf)
+
+%.pcf: %.bdf
+	bdftopcf $< -o $@
+%.pcf.gz: %.pcf
+	gzip -9 < $< > $@
+
+kc24f.bdf:	kc24f 
+	./kc24f > kc24f.bdf
+kc15f.bdf:	kc15f
+	./kc15f >kc15f.bdf
+kc8x15.bdf:	kca2et kc8x15
 	./kca2et kctext16.f00 ascfont.15 256 16 15
 	./kc8x15 > kc8x15.bdf
 	patch < kc8x15.diff
-	bdftopcf kc8x15.bdf | gzip - > kc8x15.pcf.gz
-kc12x24.pcf.gz:	kca2et kc12x24
+kc12x24.bdf:	kca2et kc12x24
 	./kca2et kctext24.f00 ascfont.24 256 48 48
 	./kc12x24 > kc12x24.bdf
 	patch < kc12x24.diff
-	bdftopcf kc12x24.bdf | gzip - > kc12x24.pcf.gz
 
 kc24f:		tran.o kc24f.o
 	$(CC) $(CFLAGS) tran.o kc24f.o -o $@
@@ -52,4 +57,4 @@
 	mkfontdir $(EFONTDIR)
 
 clean:
-	rm -f kc*.pcf.gz ascfont.* *.o *~ $(PROGS)
+	rm -f kc*.pcf.gz ascfont.* *.o *~ $(PROGS) *.pcf *.bdf
diff -Nuar kcfonts-1.05.orig/kc12x24.c kcfonts-1.05/kc12x24.c
--- kcfonts-1.05.orig/kc12x24.c	2006-01-11 16:33:36.980772000 -0800
+++ kcfonts-1.05/kc12x24.c	2006-01-11 16:34:33.300291750 -0800
@@ -6,6 +6,7 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 
 char bdfhead[]=
 "STARTFONT 2.1\n"
diff -Nuar kcfonts-1.05.orig/kc15f.c kcfonts-1.05/kc15f.c
--- kcfonts-1.05.orig/kc15f.c	2006-01-11 16:33:36.980772000 -0800
+++ kcfonts-1.05/kc15f.c	2006-01-11 16:36:44.316479750 -0800
@@ -8,6 +8,8 @@
 
 #include <stdio.h>
 #include <sys/types.h>
+#include <stdlib.h>
+#include "tran.h"
 
 char head[]=
 "STARTFONT 2.1\n"
@@ -66,7 +68,7 @@
 	fprintf(stdout,"ENDCHAR\n");
 }
 
-main()
+int main()
 {
 
 	if ((fp=fopen("spcfont.15","r"))==NULL) {
@@ -111,5 +113,8 @@
 
 	fprintf(stdout,"ENDFONT\n");
 
-	fclose(fp);
+	// fp points to f2, which is either closed or already invalid here.
+	// We don't care about leaking a single fd this late anyway
+	//fclose(fp);
+	return 0;
 }
diff -Nuar kcfonts-1.05.orig/kc24f.c kcfonts-1.05/kc24f.c
--- kcfonts-1.05.orig/kc24f.c	2006-01-11 16:33:36.980772000 -0800
+++ kcfonts-1.05/kc24f.c	2006-01-11 16:37:14.438362250 -0800
@@ -7,6 +7,8 @@
 
 #include <stdio.h>
 #include <sys/types.h>
+#include <stdlib.h>
+#include "tran.h"
 
 char head[]=
 "STARTFONT 2.1\n"
@@ -45,7 +47,7 @@
 {
 u_char tt[3],uu[3];
 u_char bf[24][3];
-int v,i,j,zc;
+int v,i,zc;
 
 
 if ((v=fread(bf,1,72,fp)) != 72) return; 
@@ -66,7 +68,7 @@
 fprintf(stdout,"ENDCHAR\n");
 }
 
-main()
+int main()
 {
 
 if ((fp=fopen("spcfont.24","r"))==NULL) {
@@ -110,5 +112,8 @@
 
 fprintf(stdout,"ENDFONT\n");
 
-fclose(fp);
+// fp points to f2, which is either closed or already invalid here.
+// We don't care about leaking a single fd this late anyway
+//fclose(fp);
+return 0;
 }
diff -Nuar kcfonts-1.05.orig/kc8x15.c kcfonts-1.05/kc8x15.c
--- kcfonts-1.05.orig/kc8x15.c	2006-01-11 16:33:36.980772000 -0800
+++ kcfonts-1.05/kc8x15.c	2006-01-11 16:34:43.984959500 -0800
@@ -6,6 +6,7 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 
 char bdfhead[]=
 "STARTFONT 2.1\n"
diff -Nuar kcfonts-1.05.orig/kca2et.c kcfonts-1.05/kca2et.c
--- kcfonts-1.05.orig/kca2et.c	1995-12-16 09:22:25.000000000 -0800
+++ kcfonts-1.05/kca2et.c	2006-01-11 16:35:33.604060500 -0800
@@ -10,7 +10,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-void main(int argc, char **argv)
+int main(int argc, char **argv)
 {
 	int i;
 	unsigned char tmp[60];
@@ -29,5 +29,6 @@
 	
 	fclose( fp );
 	fclose( fout );
+	return 0;
 }
 
diff -Nuar kcfonts-1.05.orig/tran.c kcfonts-1.05/tran.c
--- kcfonts-1.05.orig/tran.c	1995-12-16 09:22:06.000000000 -0800
+++ kcfonts-1.05/tran.c	2006-01-11 16:18:10.186851000 -0800
@@ -4,6 +4,7 @@
  */
  
 #include <sys/types.h>
+#include <stdio.h>
 
 void ser_b5(u_char *ch, u_char *tt)
 {
diff -Nuar kcfonts-1.05.orig/tran.h kcfonts-1.05/tran.h
--- kcfonts-1.05.orig/tran.h	1969-12-31 16:00:00.000000000 -0800
+++ kcfonts-1.05/tran.h	2006-01-11 16:36:26.099341250 -0800
@@ -0,0 +1,3 @@
+#include <sys/types.h>
+void ser_b5(u_char *ch, u_char *tt);
+void b5_ser(u_char *s, u_char *t);