]>
Commit | Line | Data |
---|---|---|
7ff3f729 | 1 | --- ed-0.2.orig/glbl.c |
2 | +++ ed-0.2/glbl.c | |
3 | @@ -128,8 +128,8 @@ | |
4 | for (; *ibufp;) | |
5 | if ((status = extract_addr_range ()) < 0 || | |
6 | (status = exec_command ()) < 0 || | |
7 | - status > 0 && (status = display_lines ( | |
8 | - current_addr, current_addr, status)) < 0) | |
9 | + (status > 0 && (status = display_lines ( | |
10 | + current_addr, current_addr, status)) < 0)) | |
11 | return status; | |
12 | } | |
13 | return 0; | |
14 | --- ed-0.2.orig/io.c | |
15 | +++ ed-0.2/io.c | |
16 | @@ -100,7 +100,7 @@ | |
17 | return ERR; | |
18 | if (o_n && appended && size && o_isbinary && o_newline_added) | |
19 | fputs ("Newline inserted\n", stderr); | |
20 | - else if (newline_added && (!appended || !isbinary && !o_isbinary)) | |
21 | + else if (newline_added && (!appended || (!isbinary && !o_isbinary))) | |
22 | fputs ("Newline appended\n", stderr); | |
23 | if (isbinary && newline_added && !appended) | |
24 | size += 1; | |
25 | @@ -120,8 +120,8 @@ | |
26 | register int c; | |
27 | register int i = 0; | |
28 | ||
29 | - while (((c = getc (fp)) != EOF || !feof (fp) && | |
30 | - !ferror (fp)) && c != '\n') | |
31 | + while (((c = getc (fp)) != EOF || (!feof (fp) && | |
32 | + !ferror (fp))) && c != '\n') | |
33 | { | |
34 | REALLOC (sbuf, sbufsz, i + 1, ERR); | |
35 | if (!(sbuf[i++] = c)) | |
36 | --- ed-0.2.orig/main.c | |
37 | +++ ed-0.2/main.c | |
38 | @@ -165,6 +165,11 @@ | |
39 | int c, n; | |
40 | long status = 0; | |
41 | ||
42 | +#ifdef __GNUC__ | |
43 | + (void)&argc; | |
44 | + (void)&argv; | |
45 | +#endif | |
46 | + | |
47 | program_name = argv[0]; | |
48 | red = (n = strlen (argv[0])) > 2 && argv[0][n - 3] == 'r'; | |
49 | top: | |
50 | @@ -220,7 +225,7 @@ | |
51 | reliable_signal (SIGQUIT, SIG_IGN); | |
52 | reliable_signal (SIGINT, signal_int); | |
53 | #ifdef HAVE_SIGSETJMP | |
54 | - if (status = sigsetjmp (env, 1)) | |
55 | + if ((status = sigsetjmp (env, 1))) | |
56 | #else | |
57 | if (status = setjmp (env)) | |
58 | #endif | |
59 | @@ -659,7 +664,7 @@ | |
60 | return ERR; | |
61 | else if (build_active_list (c == 'g' || c == 'G') < 0) | |
62 | return ERR; | |
63 | - else if (n = (c == 'G' || c == 'V')) | |
64 | + else if ((n = (c == 'G' || c == 'V'))) | |
65 | GET_COMMAND_SUFFIX (); | |
66 | isglobal++; | |
67 | if (exec_global (n, gflag) < 0) | |
68 | @@ -1069,7 +1074,7 @@ | |
69 | return ERR; | |
70 | do | |
71 | { | |
72 | - if (n = dir ? INC_MOD (n, addr_last) : DEC_MOD (n, addr_last)) | |
73 | + if ((n = dir ? INC_MOD (n, addr_last) : DEC_MOD (n, addr_last))) | |
74 | { | |
75 | lp = get_addressed_line_node (n); | |
76 | if ((s = get_sbuf_line (lp)) == NULL) | |
77 | @@ -1648,7 +1653,7 @@ | |
78 | ||
79 | REALLOC (file, filesz, PATH_MAX + 1, NULL); | |
80 | /* assert: no trailing escape */ | |
81 | - while (file[i++] = (*s == '\\') ? *++s : *s) | |
82 | + while ((file[i++] = (*s == '\\') ? *++s : *s)) | |
83 | s++; | |
84 | return file; | |
85 | } | |
86 | --- ed-0.2.orig/re.c | |
87 | +++ ed-0.2/re.c | |
88 | @@ -62,7 +62,7 @@ | |
89 | return NULL; | |
90 | } | |
91 | patlock = 0; | |
92 | - if (n = regcomp (exp, exps, 0)) | |
93 | + if ((n = regcomp (exp, exps, 0))) | |
94 | { | |
95 | regerror (n, exp, errmsg, ERRSZ); | |
96 | free (exp); | |
97 | --- ed-0.2.orig/sub.c | |
98 | +++ ed-0.2/sub.c | |
99 | @@ -101,7 +101,7 @@ | |
100 | else if (!isglobal) | |
101 | { | |
102 | while ((n = get_tty_line ()) == 0 || | |
103 | - n > 0 && ibuf[n - 1] != '\n') | |
104 | + (n > 0 && ibuf[n - 1] != '\n')) | |
105 | clearerr (stdin); | |
106 | if (n < 0) | |
107 | return NULL; | |
108 | @@ -229,7 +229,7 @@ | |
109 | } | |
110 | txt += rm[0].rm_eo; | |
111 | } | |
112 | - while (*txt && (!changed || (gflag & GSG) && rm[0].rm_eo) && | |
113 | + while (*txt && (!changed || ((gflag & GSG) && rm[0].rm_eo)) && | |
114 | !regexec (pat, txt, SE_MAX, rm, REG_NOTBOL)); | |
115 | i = eot - txt; | |
116 | REALLOC (rbuf, rbufsz, off + i + 2, ERR); | |
117 | --- ed-0.2.orig/Makefile.in | |
118 | +++ ed-0.2/Makefile.in | |
119 | @@ -65,8 +65,8 @@ | |
120 | ||
121 | all: ed | |
122 | ||
123 | -ed: $(OBJECTS) libed.a | |
124 | - $(CC) $(LDFLAGS) -o ed $(OBJECTS) libed.a $(LIBS) | |
125 | +ed: $(OBJECTS) | |
126 | + $(CC) $(LDFLAGS) -o ed $(OBJECTS) $(LIBS) | |
127 | ||
128 | buf.o: ed.h config.h regex.h | |
129 | ed.o: ed.h config.h regex.h | |
130 | --- ed-0.2.orig/ed.1 | |
131 | +++ ed-0.2/ed.1 | |
132 | @@ -196,14 +196,14 @@ | |
133 | The last line in the buffer. | |
134 | ||
135 | .TP 8 | |
136 | -n | |
137 | +.I n | |
138 | The | |
139 | .IR n th, | |
140 | line in the buffer | |
141 | where | |
142 | .I n | |
143 | is a number in the range | |
144 | -.I [0,$]. | |
145 | +.IR [0,$] . | |
146 | ||
147 | .HP | |
148 | - | |
149 | @@ -215,9 +215,9 @@ | |
150 | and may be repeated with cumulative effect. | |
151 | ||
152 | .HP | |
153 | --\fIn\fR | |
154 | +.RI - n | |
155 | .TP 8 | |
156 | -^\fIn\fR | |
157 | +.RI ^ n | |
158 | The | |
159 | .IR n th | |
160 | previous line, where | |
161 | @@ -235,7 +235,7 @@ | |
162 | .HP | |
163 | +\fIn\fR | |
164 | .TP 8 | |
165 | -whitespace \fIn\fR | |
166 | +.I whitespace n | |
167 | The | |
168 | .IR n th | |
169 | next line, where | |
170 | @@ -253,16 +253,16 @@ | |
171 | % | |
172 | The first through last lines in the buffer. This is equivalent to | |
173 | the address range | |
174 | -.I 1,$. | |
175 | +.IR 1,$ . | |
176 | ||
177 | .TP 8 | |
178 | ; | |
179 | The current through last lines in the buffer. This is equivalent to | |
180 | the address range | |
181 | -.I .,$. | |
182 | +.IR .,$ . | |
183 | ||
184 | .TP 8 | |
185 | -.RI / re/ | |
186 | +.RI / re / | |
187 | The | |
188 | next line containing the regular expression | |
189 | .IR re . | |
190 | @@ -271,7 +271,7 @@ | |
191 | // repeats the last search. | |
192 | ||
193 | .TP 8 | |
194 | -.RI ? re? | |
195 | +.RI ? re ? | |
196 | The | |
197 | previous line containing the regular expression | |
198 | .IR re . | |
199 | @@ -280,7 +280,7 @@ | |
200 | ?? repeats the last search. | |
201 | ||
202 | .TP 8 | |
203 | -.RI \' lc | |
204 | +.RI ' lc | |
205 | The | |
206 | line previously marked by a | |
207 | .I `k' | |
208 | @@ -331,7 +331,7 @@ | |
209 | matches itself. | |
210 | ||
211 | .TP 8 | |
212 | -\fR.\fR | |
213 | +\&. | |
214 | Matches any single character. | |
215 | ||
216 | .TP 8 | |
217 | @@ -482,7 +482,7 @@ | |
218 | \fR\e+\fR | |
219 | Matches the single character regular expression or subexpression | |
220 | immediately preceding it one or more times. So the regular expression | |
221 | -`a+' is shorthand for `aa*'. If \e+ occurs at the beginning of a | |
222 | +`a\e+' is shorthand for `aa*'. If \e+ occurs at the beginning of a | |
223 | regular expression or subexpression, then it matches a literal `+'. | |
224 | ||
225 | ||
226 | @@ -564,7 +564,7 @@ | |
227 | The current address is set to the last line read. | |
228 | ||
229 | .TP 8 | |
230 | -.RI e \ !command | |
231 | +e !\fIcommand\fR | |
232 | Edits the standard output of | |
233 | .IR `!command' , | |
234 | (see | |
235 | @@ -746,7 +746,7 @@ | |
236 | The current address is set to the last line read. | |
237 | ||
238 | .TP 8 | |
239 | -.RI ($)r \ !command | |
240 | +($)r !\fIcommand\fR | |
241 | Reads | |
242 | to after the addressed line | |
243 | the standard output of | |
244 | @@ -843,7 +843,7 @@ | |
245 | suffix toggles the global suffix of the last substitution. | |
246 | The | |
247 | .I `p' | |
248 | -suffix toggles the print suffix of the last substitution | |
249 | +suffix toggles the print suffix of the last substitution. | |
250 | The current address is set to the last line affected. | |
251 | ||
252 | .TP 8 | |
253 | @@ -909,7 +909,7 @@ | |
254 | command. | |
255 | ||
256 | .TP 8 | |
257 | -.RI (1,$)w \ !command | |
258 | +(1,$)w !\fIcommand\fR | |
259 | Writes the addressed lines to the standard input of | |
260 | .IR `!command' , | |
261 | (see the | |
262 | y |