]>
Commit | Line | Data |
---|---|---|
b0801ae9 | 1 | --- b.c.old Tue Mar 19 20:39:33 2002 |
2 | +++ b.c Tue Mar 19 20:39:47 2002 | |
3 | @@ -432,7 +432,7 @@ | |
4 | P *q = pdup(p); | |
5 | ||
6 | p_goto_bol(q); | |
7 | - while (isblank(brc(q))) | |
8 | + while (isblank_(brc(q))) | |
9 | pgetc(q); | |
10 | if (piseol(q)) { | |
11 | prm(q); | |
12 | @@ -449,7 +449,7 @@ | |
13 | long col; | |
14 | ||
15 | p_goto_bol(q); | |
16 | - while (isblank(brc(q))) | |
17 | + while (isblank_(brc(q))) | |
18 | pgetc(q); | |
19 | col = q->col; | |
20 | prm(q); | |
21 | --- macro.c.old Tue Mar 19 20:40:55 2002 | |
22 | +++ macro.c Tue Mar 19 20:41:02 2002 | |
23 | @@ -129,7 +129,7 @@ | |
24 | macroloop: | |
25 | ||
26 | /* Skip whitespace */ | |
27 | - while (isblank(buf[x])) | |
28 | + while (isblank_(buf[x])) | |
29 | ++x; | |
30 | ||
31 | /* Do we have a string? */ | |
32 | @@ -231,13 +231,13 @@ | |
33 | } | |
34 | ||
35 | /* Skip whitespace */ | |
36 | - while (isblank(buf[x])) | |
37 | + while (isblank_(buf[x])) | |
38 | ++x; | |
39 | ||
40 | /* Do we have a comma? */ | |
41 | if (buf[x] == ',') { | |
42 | ++x; | |
43 | - while (isblank(buf[x])) | |
44 | + while (isblank_(buf[x])) | |
45 | ++x; | |
46 | if (buf[x] && buf[x] != '\r' && buf[x] != '\n') | |
47 | goto macroloop; | |
48 | --- rc.c.old Tue Mar 19 20:29:05 2002 | |
49 | +++ rc.c Tue Mar 19 20:39:16 2002 | |
50 | @@ -304,7 +304,7 @@ | |
51 | if (arg) { | |
52 | int y; | |
53 | ||
54 | - for (y = 0; !isspace(arg[y]); ++y) ; | |
55 | + for (y = 0; !isspace_(arg[y]); ++y) ; | |
56 | if (!arg[y]) | |
57 | arg[y] = 0; | |
58 | if (options && y) | |
59 | @@ -638,7 +638,7 @@ | |
60 | if (!strcmp(buf + 1, "def")) { | |
61 | int y; | |
62 | ||
63 | - for (buf[x] = c; isblank(buf[x]); ++x) ; | |
64 | + for (buf[x] = c; isblank_(buf[x]); ++x) ; | |
65 | for (y = x; !isspace_eof(buf[y]); ++y) ; | |
66 | c = buf[y]; | |
67 | buf[y] = 0; | |
68 | @@ -646,7 +646,7 @@ | |
69 | int sta; | |
70 | MACRO *m; | |
71 | ||
72 | - if (isblank(c) | |
73 | + if (isblank_(c) | |
74 | && (m = mparse(NULL, buf + y + 1, &sta))) | |
75 | addcmd(buf + x, m); | |
76 | else { | |
77 | @@ -659,7 +659,7 @@ | |
78 | } | |
79 | } else if (!strcmp(buf + 1, "inherit")) | |
80 | if (context) { | |
81 | - for (buf[x] = c; isblank(buf[x]); ++x) ; | |
82 | + for (buf[x] = c; isblank_(buf[x]); ++x) ; | |
83 | for (c = x; !isspace_eof(buf[c]); ++c) ; | |
84 | buf[c] = 0; | |
85 | if (c != x) | |
86 | @@ -672,7 +672,7 @@ | |
87 | err = 1; | |
88 | fprintf(stderr, "\n%s %d: No context selected for :inherit", name, line); | |
89 | } else if (!strcmp(buf + 1, "include")) { | |
90 | - for (buf[x] = c; isblank(buf[x]); ++x) ; | |
91 | + for (buf[x] = c; isblank_(buf[x]); ++x) ; | |
92 | for (c = x; !isspace_eof(buf[c]); ++c) ; | |
93 | buf[c] = 0; | |
94 | if (c != x) { | |
95 | @@ -695,7 +695,7 @@ | |
96 | if (context) { | |
97 | int y; | |
98 | ||
99 | - for (buf[x] = c; isblank(buf[x]); ++x) ; | |
100 | + for (buf[x] = c; isblank_(buf[x]); ++x) ; | |
101 | for (y = x; buf[y] != 0 && buf[y] != '\t' && buf[y] != '\n' && (buf[y] != ' ' || buf[y + 1] | |
102 | != ' '); ++y) ; | |
103 | buf[y] = 0; | |
104 | --- uedit.c.old Tue Mar 19 20:29:41 2002 | |
105 | +++ uedit.c Tue Mar 19 20:39:01 2002 | |
106 | @@ -99,8 +99,8 @@ | |
107 | { | |
108 | if (pisbof(bw->cursor)) { | |
109 | return -1; /* cursor is at beginning of file */ | |
110 | - } else if (isspace(prgetc(bw->cursor))) { | |
111 | - while ((!pisbof(bw->cursor)) && (isspace(prgetc(bw->cursor)))) | |
112 | + } else if (isspace_(prgetc(bw->cursor))) { | |
113 | + while ((!pisbof(bw->cursor)) && (isspace_(prgetc(bw->cursor)))) | |
114 | /* do nothing */; /* if cursor is on white-space char then find first non-white-space char */ | |
115 | } | |
116 | if (pisbof(bw->cursor)) { | |
117 | @@ -109,7 +109,7 @@ | |
118 | pgetc(bw->cursor); | |
119 | ||
120 | while (!pisbof(bw->cursor)) { | |
121 | - if (isspace(prgetc(bw->cursor))) { /* if previous character is white-space then beginning of word was found */ | |
122 | + if (isspace_(prgetc(bw->cursor))) { /* if previous character is white-space then beginning of word was found */ | |
123 | pgetc(bw->cursor); | |
124 | break; | |
125 | } | |
126 | @@ -127,8 +127,8 @@ | |
127 | { | |
128 | if (piseof(bw->cursor)) { | |
129 | return -1; /* cursor is at end of file */ | |
130 | - } else if (isspace(pgetc(bw->cursor))) { | |
131 | - while ((!piseof(bw->cursor)) && (isspace(pgetc(bw->cursor)))) | |
132 | + } else if (isspace_(pgetc(bw->cursor))) { | |
133 | + while ((!piseof(bw->cursor)) && (isspace_(pgetc(bw->cursor)))) | |
134 | /* do nothing */; /* if cursor is on white-space char then find first non-white-space char */ | |
135 | } | |
136 | if (piseof(bw->cursor)) { | |
137 | @@ -137,7 +137,7 @@ | |
138 | prgetc(bw->cursor); | |
139 | ||
140 | while (!piseof(bw->cursor)) { | |
141 | - if (isspace(pgetc(bw->cursor))) { /* if next character is white-space then end of word was found */ | |
142 | + if (isspace_(pgetc(bw->cursor))) { /* if next character is white-space then end of word was found */ | |
143 | prgetc(bw->cursor); | |
144 | break; | |
145 | } | |
146 | @@ -148,7 +148,7 @@ | |
147 | static P *pboi(P *p) | |
148 | { | |
149 | p_goto_bol(p); | |
150 | - while (isblank(brc(p))) | |
151 | + while (isblank_(brc(p))) | |
152 | pgetc(p); | |
153 | return p; | |
154 | } | |
155 | @@ -166,9 +166,9 @@ | |
156 | pboi(q); | |
157 | if (q->byte == p->byte) | |
158 | goto left; | |
159 | - if (isblank(c = brc(p))) { | |
160 | + if (isblank_(c = brc(p))) { | |
161 | pset(q, p); | |
162 | - if (isblank(prgetc(q))) | |
163 | + if (isblank_(prgetc(q))) | |
164 | goto no; | |
165 | if (c == '\t') | |
166 | goto right; | |
167 | @@ -660,8 +660,8 @@ | |
168 | if (isalnum_(c)) | |
169 | while (c = brc(p), isalnum_(c)) | |
170 | pgetc(p); | |
171 | - else if (isspace(c)) | |
172 | - while (c = brc(p), isspace(c)) | |
173 | + else if (isspace_(c)) | |
174 | + while (c = brc(p), isspace_(c)) | |
175 | pgetc(p); | |
176 | else | |
177 | pgetc(p); | |
178 | @@ -689,8 +689,8 @@ | |
179 | /* do nothing */; | |
180 | if (c != MAXINT) | |
181 | pgetc(bw->cursor); | |
182 | - } else if (isspace(c)) { | |
183 | - while (c = prgetc(bw->cursor), isspace(c)) | |
184 | + } else if (isspace_(c)) { | |
185 | + while (c = prgetc(bw->cursor), isspace_(c)) | |
186 | /* do nothing */; | |
187 | if (c != MAXINT) | |
188 | pgetc(bw->cursor); | |
189 | @@ -788,7 +788,7 @@ | |
190 | while (piscol(bw->cursor) < bw->o.lmargin) | |
191 | binsc(bw->cursor, ' '), pgetc(bw->cursor); | |
192 | binsc(bw->cursor, k), pgetc(bw->cursor); | |
193 | - if (bw->o.wordwrap && piscol(bw->cursor) > bw->o.rmargin && !isblank(k)) | |
194 | + if (bw->o.wordwrap && piscol(bw->cursor) > bw->o.rmargin && !isblank_(k)) | |
195 | wrapword(bw->cursor, (long) bw->o.lmargin, bw->o.french, NULL), simple = 0; | |
196 | else if (bw->o.overtype && !piseol(bw->cursor) | |
197 | && k != '\t') | |
198 | @@ -1054,7 +1054,7 @@ | |
199 | binsc(bw->cursor, '\n'), pgetc(bw->cursor); | |
200 | if (bw->o.autoindent) { | |
201 | p_goto_bol(p); | |
202 | - while (isspace(c = pgetc(p)) && c != 10) | |
203 | + while (isspace_(c = pgetc(p)) && c != 10) | |
204 | binsc(bw->cursor, c), pgetc(bw->cursor); | |
205 | } | |
206 | prm(p); | |
207 | --- uformat.c.old Tue Mar 19 20:34:20 2002 | |
208 | +++ uformat.c Tue Mar 19 20:40:36 2002 | |
209 | @@ -26,7 +26,7 @@ | |
210 | int c; | |
211 | ||
212 | p_goto_eol(p); | |
213 | - while (isblank(c = prgetc(p))) | |
214 | + while (isblank_(c = prgetc(p))) | |
215 | /* do nothing */; | |
216 | if (c == '\n') { | |
217 | pgetc(p); | |
218 | @@ -38,7 +38,7 @@ | |
219 | endcol = piscol(p); | |
220 | ||
221 | p_goto_bol(p); | |
222 | - while (isblank(c = pgetc(p))) | |
223 | + while (isblank_(c = pgetc(p))) | |
224 | /* do nothing */; | |
225 | if (c == '\n') { | |
226 | prgetc(p); | |
227 | @@ -129,7 +129,7 @@ | |
228 | while (cpara(brc(q))) | |
229 | pgetc(q); | |
230 | while (!pisbol(q)) | |
231 | - if (!isblank(prgetc(q))) { | |
232 | + if (!isblank_(prgetc(q))) { | |
233 | pgetc(q); | |
234 | break; | |
235 | } | |
236 | @@ -285,7 +285,7 @@ | |
237 | p_goto_bol(r); | |
238 | q = pdup(r); | |
239 | while(cpara(c = brc(q))) { | |
240 | - if(!isblank(c)) | |
241 | + if(!isblank_(c)) | |
242 | f = 1; | |
243 | pgetc(q); | |
244 | } | |
245 | @@ -301,7 +301,7 @@ | |
246 | */ | |
247 | ||
248 | /* Get to beginning of word */ | |
249 | - while (!pisbol(p) && piscol(p) > indent && !isblank(prgetc(p))) | |
250 | + while (!pisbol(p) && piscol(p) > indent && !isblank_(prgetc(p))) | |
251 | /* do nothing */; | |
252 | ||
253 | /* If we found the beginning of a word... */ | |
254 | @@ -310,7 +310,7 @@ | |
255 | word */ | |
256 | q = pdup(p); | |
257 | while (!pisbol(q)) | |
258 | - if (!isblank(c = prgetc(q))) { | |
259 | + if (!isblank_(c = prgetc(q))) { | |
260 | pgetc(q); | |
261 | if ((c == '.' || c == '?' || c == '!') | |
262 | && q->byte != p->byte && !french) | |
263 | @@ -428,7 +428,7 @@ | |
264 | } | |
265 | ||
266 | /* Stop if we found white-space followed by end of line */ | |
267 | - if (isblank(c)) { | |
268 | + if (isblank_(c)) { | |
269 | char *r = b; | |
270 | int rlen = len; | |
271 | int z; | |
272 | @@ -437,7 +437,7 @@ | |
273 | z = *r++; | |
274 | if (z == '\n') | |
275 | break; | |
276 | - if (!isblank(z)) | |
277 | + if (!isblank_(z)) | |
278 | goto ok; | |
279 | } | |
280 | ++len; | |
281 | @@ -451,7 +451,7 @@ | |
282 | pgetc(p); | |
283 | ||
284 | /* Do word wrap if we reach right margin */ | |
285 | - if (piscol(p) > bw->o.rmargin && !isblank(c)) { | |
286 | + if (piscol(p) > bw->o.rmargin && !isblank_(c)) { | |
287 | wrapword(p, indent, bw->o.french, indents); | |
288 | break; | |
289 | } | |
290 | @@ -460,12 +460,12 @@ | |
291 | /* Do rest */ | |
292 | ||
293 | while (len > 0) | |
294 | - if (isspace(*b) || *b == '\r') { | |
295 | + if (isspace_(*b) || *b == '\r') { | |
296 | int f = 0; | |
297 | ||
298 | /* Set f if there are two spaces after . ? or ! instead of one */ | |
299 | if ((b[-1] == '.' || b[-1] == '?' || b[-1] == '!') | |
300 | - && isspace(b[1])) | |
301 | + && isspace_(b[1])) | |
302 | f = 1; | |
303 | ||
304 | /* Skip past the whitespace. Skip over indentations */ | |
305 | @@ -488,7 +488,7 @@ | |
306 | } | |
307 | } | |
308 | ||
309 | - if (len && isblank(*b)) { | |
310 | + if (len && isblank_(*b)) { | |
311 | if (b - buf == curoff) | |
312 | pset(bw->cursor, p); | |
313 | ++b, --len; | |
314 | --- utils.c.old Tue Mar 19 20:34:41 2002 | |
315 | +++ utils.c Tue Mar 19 20:42:43 2002 | |
316 | @@ -28,7 +28,17 @@ | |
317 | */ | |
318 | int isspace_eof(int c) | |
319 | { | |
320 | - return(isspace(c) || (!c)); | |
321 | + return(isspace_(c) || (!c)); | |
322 | +} | |
323 | + | |
324 | +int isspace_(int c) | |
325 | +{ | |
326 | + return(c >= 0 && c < 256 && isspace(c)); | |
327 | +} | |
328 | + | |
329 | +int isblank_(int c) | |
330 | +{ | |
331 | + return(c >= 0 && c < 256 && isblank(c)); | |
332 | } | |
333 | ||
334 | /* | |
335 | --- utils.h.old Tue Mar 19 20:40:04 2002 | |
336 | +++ utils.h Tue Mar 19 20:40:08 2002 | |
337 | @@ -38,7 +38,7 @@ | |
338 | * even #including <ctype.h> without additional hackery doesn't import | |
339 | * the prototype, so we define it here unconditionaly | |
340 | */ | |
341 | -int isblank PARAMS((int c)); | |
342 | +int isblank_ PARAMS((int c)); | |
343 | ||
344 | /* | |
345 | * Functions which return minimum/maximum of two numbers |