-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathFix-2
279 lines (244 loc) · 7.01 KB
/
Fix-2
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
Please forward this to the maintainer of nenscript.
In the process of porting nenscript to a 386-bsd computer I made an attempt
to fix all warnings given by gcc -Wall. Here are the diffs from my previous
version (with ISO Latin1 support), most fixes seems quite trivial, but there
was one bug in the handling of multiple files in main.c, which seems
quite important.
Regards
Jonas Lagerblad
----------
diff -c /nfs/albert/src/nenscript-1.13/machdep.h ./machdep.h
*** /nfs/albert/src/nenscript-1.13/machdep.h Thu Nov 19 14:34:27 1992
--- ./machdep.h Tue Nov 24 10:41:36 1992
***************
*** 41,46 ****
--- 41,49 ----
# include <pwd.h>
# include <string.h>
+ # ifdef __STDC__
+ # include <unistd.h>
+ # endif
# define LPR "lpr -P " /* spooler with option to set name of printer */
diff -c /nfs/albert/src/nenscript-1.13/main.c ./main.c
*** /nfs/albert/src/nenscript-1.13/main.c Wed Oct 7 15:06:46 1992
--- ./main.c Tue Nov 24 10:57:21 1992
***************
*** 17,26 ****
#include "defs.h"
#include "version.h"
- #include "postscri.h"
#include "print.h"
#include "main.h"
#include "paper.h"
/********************************
defines
--- 17,26 ----
#include "defs.h"
#include "version.h"
#include "print.h"
#include "main.h"
#include "paper.h"
+ #include "postscri.h"
/********************************
defines
***************
*** 143,149 ****
}
}
if (copies < 1) {
! fprintf (stderr, "%s: illegal number of copies specified - defaulting to one\n");
copies = 1;
}
goto next_argv;
--- 143,149 ----
}
}
if (copies < 1) {
! fprintf (stderr, "%s: illegal number of copies specified - defaulting to one\n", progname);
copies = 1;
}
goto next_argv;
***************
*** 349,357 ****
if (*++ARGV[0])
s = ARGV[0];
else {
! if (ARGC < 1)
fprintf (stderr, "%s: -t option requires argument\n", progname);
! else {
--ARGC;
s = *++ARGV;
}
--- 349,358 ----
if (*++ARGV[0])
s = ARGV[0];
else {
! if (ARGC < 1) {
fprintf (stderr, "%s: -t option requires argument\n", progname);
! s = 0; /* We should flag the error in some way */
! } else {
--ARGC;
s = *++ARGV;
}
***************
*** 486,492 ****
int argc;
char *s;
char **argv;
- int i;
if (env == NULL)
return;
--- 487,492 ----
***************
*** 658,664 ****
perror (*argv);
else {
print_file (inputstream, outputstream, (filetitle ? filetitle : *argv), line_numbers);
! inputstream == NULL;
}
argv++;
}
--- 658,665 ----
perror (*argv);
else {
print_file (inputstream, outputstream, (filetitle ? filetitle : *argv), line_numbers);
! fclose(inputstream);
! inputstream = NULL;
}
argv++;
}
diff -c /nfs/albert/src/nenscript-1.13/makefile ./makefile
*** /nfs/albert/src/nenscript-1.13/makefile Thu Nov 19 18:23:19 1992
--- ./makefile Tue Nov 24 10:56:48 1992
***************
*** 33,39 ****
CP = cp
RM = rm
INSTALL = /etc/install
! INSTALL = install
all debug: $(PROG)
--- 33,39 ----
CP = cp
RM = rm
INSTALL = /etc/install
! INSTALL = install -c
all debug: $(PROG)
diff -c /nfs/albert/src/nenscript-1.13/postscri.c ./postscri.c
*** /nfs/albert/src/nenscript-1.13/postscri.c Thu Nov 19 18:41:52 1992
--- ./postscri.c Tue Nov 24 10:41:34 1992
***************
*** 24,29 ****
--- 24,31 ----
#include "fontwidt.h"
#include "font_lis.h"
+ #include <ctype.h>
+
/********************************
defines
********************************/
***************
*** 181,187 ****
/* call the StartPage procedure with the appropriate arguments */
fprintf (stream, "(%li) ", PageNum);
PrintPSString (stream, CurrentFilename, strlen (CurrentFilename));
! fprintf (stream, " StartPage\n", PageNum);
/* set X and Y location */
X = LM;
--- 183,189 ----
/* call the StartPage procedure with the appropriate arguments */
fprintf (stream, "(%li) ", PageNum);
PrintPSString (stream, CurrentFilename, strlen (CurrentFilename));
! fprintf (stream, " StartPage\n");
/* set X and Y location */
X = LM;
***************
*** 258,264 ****
int first;
{
- char *p;
long i;
if (!touched_page)
--- 260,265 ----
***************
*** 296,302 ****
char *line;
{
- int l;
int first = True;
char *p;
char *q;
--- 297,302 ----
***************
*** 622,628 ****
/* define a variable for our body font, and calculate the character width for later use */
fprintf (stream, "/BodyF { %li /%s /%s-Latin1 ChgFnt } def\n", BFH, bodyfont,
! bodyfont, BFH);
fprintf (stream, "/CW BodyF ( ) stringwidth pop def\n");
/* define variables for various other font used - title, gaudy page number, gaudy date, gaudy title */
--- 622,628 ----
/* define a variable for our body font, and calculate the character width for later use */
fprintf (stream, "/BodyF { %li /%s /%s-Latin1 ChgFnt } def\n", BFH, bodyfont,
! bodyfont);
fprintf (stream, "/CW BodyF ( ) stringwidth pop def\n");
/* define variables for various other font used - title, gaudy page number, gaudy date, gaudy title */
diff -c /nfs/albert/src/nenscript-1.13/print.c ./print.c
*** /nfs/albert/src/nenscript-1.13/print.c Thu Oct 1 18:02:54 1992
--- ./print.c Tue Nov 24 10:41:33 1992
***************
*** 18,23 ****
--- 18,24 ----
#include "defs.h"
#include "print.h"
+ #include "paper.h"
#include "postscri.h"
#include "main.h"
***************
*** 42,48 ****
char line[8192+1];
int touched = False;
char *p;
! long line_num;
char *buffer;
int bufflen;
--- 43,49 ----
char line[8192+1];
int touched = False;
char *p;
! long line_num = 1;
char *buffer;
int bufflen;
***************
*** 52,58 ****
if (line_numbers) {
buffer += 8;
bufflen -= 8;
! sprintf (line, "%7lu:", line_num = 1);
}
StartDocument (output, filename);
--- 53,59 ----
if (line_numbers) {
buffer += 8;
bufflen -= 8;
! sprintf (line, "%7lu:", line_num);
}
StartDocument (output, filename);
diff -c /nfs/albert/src/nenscript-1.13/version.h ./version.h
*** /nfs/albert/src/nenscript-1.13/version.h Wed Oct 7 15:06:30 1992
--- ./version.h Tue Nov 24 11:00:14 1992
***************
*** 14,22 ****
*/
#ifndef US_VERSION
! char * version_string = "nenscript v1.13 8-October-1992";
#else
! char * version_string = "nenscript v1.13 (US version) 8-October-1992";
#endif
char * copyright_string = "\
--- 14,22 ----
*/
#ifndef US_VERSION
! char * version_string = "nenscript v1.13++ 24-November-1992";
#else
! char * version_string = "nenscript v1.13++ (US version) 24-November-1992";
#endif
char * copyright_string = "\