]>
Commit | Line | Data |
---|---|---|
25439158 KT |
1 | diff -urN flex-2.5.4.orig/initscan.c flex-2.5.4/initscan.c |
2 | --- flex-2.5.4.orig/initscan.c Sat Sep 7 11:02:56 2002 | |
3 | +++ flex-2.5.4/initscan.c Sat Sep 7 11:05:50 2002 | |
4 | @@ -11,6 +11,7 @@ | |
5 | ||
6 | #include <stdio.h> | |
7 | #include <unistd.h> | |
8 | +#include <errno.h> | |
9 | ||
10 | /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ | |
11 | #ifdef c_plusplus | |
12 | @@ -1291,7 +1292,15 @@ | |
13 | return CHAR; | |
14 | ||
15 | #define RETURNNAME \ | |
16 | + if(strlen(yytext) < MAXLINE) \ | |
17 | + { \ | |
18 | strcpy( nmstr, yytext ); \ | |
19 | + } \ | |
20 | + else \ | |
21 | + { \ | |
22 | + fputs("Input line too long!\n", stderr); \ | |
23 | + exit(1); \ | |
24 | + } /* end of else */ \ | |
25 | return NAME; | |
26 | ||
27 | #define PUT_BACK_STRING(str, start) \ | |
28 | @@ -1328,7 +1337,7 @@ | |
29 | #define OPTION 17 | |
30 | #define LINEDIR 18 | |
31 | ||
32 | -#line 1333 "scan.c" | |
33 | +#line 1343 "scan.c" | |
34 | ||
35 | /* Macros after this point can all be overridden by user definitions in | |
36 | * section 1. | |
37 | @@ -1428,9 +1437,20 @@ | |
38 | YY_FATAL_ERROR( "input in flex scanner failed" ); \ | |
39 | result = n; \ | |
40 | } \ | |
41 | - else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ | |
42 | - && ferror( yyin ) ) \ | |
43 | - YY_FATAL_ERROR( "input in flex scanner failed" ); | |
44 | + else \ | |
45 | + { \ | |
46 | + errno=0; \ | |
47 | + while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ | |
48 | + { \ | |
49 | + if( errno != EINTR) \ | |
50 | + { \ | |
51 | + YY_FATAL_ERROR( "input in flex scanner failed" ); \ | |
52 | + break; \ | |
53 | + } \ | |
54 | + errno=0; \ | |
55 | + clearerr(yyin); \ | |
56 | + } \ | |
57 | + } | |
58 | #endif | |
59 | ||
60 | /* No semi-colon after return; correct usage is to write "yyterminate();" - | |
61 | @@ -1482,7 +1502,7 @@ | |
62 | register char *yy_cp, *yy_bp; | |
63 | register int yy_act; | |
64 | ||
65 | -#line 94 "scan.l" | |
66 | +#line 102 "scan.l" | |
67 | ||
68 | static int bracelevel, didadef, indented_code; | |
69 | static int doing_rule_action = false; | |
70 | @@ -1493,7 +1513,7 @@ | |
71 | Char nmdef[MAXLINE], myesc(); | |
72 | ||
73 | ||
74 | -#line 1498 "scan.c" | |
75 | +#line 1519 "scan.c" | |
76 | ||
77 | if ( yy_init ) | |
78 | { | |
79 | @@ -1580,32 +1600,32 @@ | |
80 | ||
81 | case 1: | |
82 | YY_RULE_SETUP | |
83 | -#line 105 "scan.l" | |
84 | +#line 113 "scan.l" | |
85 | indented_code = true; BEGIN(CODEBLOCK); | |
86 | YY_BREAK | |
87 | case 2: | |
88 | YY_RULE_SETUP | |
89 | -#line 106 "scan.l" | |
90 | +#line 114 "scan.l" | |
91 | ACTION_ECHO; yy_push_state( COMMENT ); | |
92 | YY_BREAK | |
93 | case 3: | |
94 | YY_RULE_SETUP | |
95 | -#line 107 "scan.l" | |
96 | +#line 115 "scan.l" | |
97 | yy_push_state( LINEDIR ); | |
98 | YY_BREAK | |
99 | case 4: | |
100 | YY_RULE_SETUP | |
101 | -#line 108 "scan.l" | |
102 | +#line 116 "scan.l" | |
103 | return SCDECL; | |
104 | YY_BREAK | |
105 | case 5: | |
106 | YY_RULE_SETUP | |
107 | -#line 109 "scan.l" | |
108 | +#line 117 "scan.l" | |
109 | return XSCDECL; | |
110 | YY_BREAK | |
111 | case 6: | |
112 | YY_RULE_SETUP | |
113 | -#line 110 "scan.l" | |
114 | +#line 118 "scan.l" | |
115 | { | |
116 | ++linenum; | |
117 | line_directive_out( (FILE *) 0, 1 ); | |
118 | @@ -1615,12 +1635,12 @@ | |
119 | YY_BREAK | |
120 | case 7: | |
121 | YY_RULE_SETUP | |
122 | -#line 117 "scan.l" | |
123 | +#line 125 "scan.l" | |
124 | /* discard */ | |
125 | YY_BREAK | |
126 | case 8: | |
127 | YY_RULE_SETUP | |
128 | -#line 119 "scan.l" | |
129 | +#line 127 "scan.l" | |
130 | { | |
131 | sectnum = 2; | |
132 | bracelevel = 0; | |
133 | @@ -1632,95 +1652,103 @@ | |
134 | YY_BREAK | |
135 | case 9: | |
136 | YY_RULE_SETUP | |
137 | -#line 128 "scan.l" | |
138 | +#line 136 "scan.l" | |
139 | yytext_is_array = false; ++linenum; | |
140 | YY_BREAK | |
141 | case 10: | |
142 | YY_RULE_SETUP | |
143 | -#line 129 "scan.l" | |
144 | +#line 137 "scan.l" | |
145 | yytext_is_array = true; ++linenum; | |
146 | YY_BREAK | |
147 | case 11: | |
148 | YY_RULE_SETUP | |
149 | -#line 131 "scan.l" | |
150 | +#line 139 "scan.l" | |
151 | BEGIN(OPTION); return OPTION_OP; | |
152 | YY_BREAK | |
153 | case 12: | |
154 | YY_RULE_SETUP | |
155 | -#line 133 "scan.l" | |
156 | +#line 141 "scan.l" | |
157 | ++linenum; /* ignore */ | |
158 | YY_BREAK | |
159 | case 13: | |
160 | YY_RULE_SETUP | |
161 | -#line 134 "scan.l" | |
162 | +#line 142 "scan.l" | |
163 | ++linenum; /* ignore */ | |
164 | YY_BREAK | |
165 | case 14: | |
166 | YY_RULE_SETUP | |
167 | -#line 136 "scan.l" | |
168 | +#line 144 "scan.l" | |
169 | synerr( _( "unrecognized '%' directive" ) ); | |
170 | YY_BREAK | |
171 | case 15: | |
172 | YY_RULE_SETUP | |
173 | -#line 138 "scan.l" | |
174 | +#line 146 "scan.l" | |
175 | +{ | |
176 | + if(strlen(yytext) < MAXLINE) | |
177 | { | |
178 | strcpy( nmstr, yytext ); | |
179 | + } | |
180 | + else | |
181 | + { | |
182 | + fputs("Input line too long!\n", stderr); | |
183 | + exit(1); | |
184 | + } /* end of else */ | |
185 | didadef = false; | |
186 | BEGIN(PICKUPDEF); | |
187 | } | |
188 | YY_BREAK | |
189 | case 16: | |
190 | YY_RULE_SETUP | |
191 | -#line 144 "scan.l" | |
192 | +#line 160 "scan.l" | |
193 | RETURNNAME; | |
194 | YY_BREAK | |
195 | case 17: | |
196 | YY_RULE_SETUP | |
197 | -#line 145 "scan.l" | |
198 | +#line 161 "scan.l" | |
199 | ++linenum; /* allows blank lines in section 1 */ | |
200 | YY_BREAK | |
201 | case 18: | |
202 | YY_RULE_SETUP | |
203 | -#line 146 "scan.l" | |
204 | +#line 162 "scan.l" | |
205 | ACTION_ECHO; ++linenum; /* maybe end of comment line */ | |
206 | YY_BREAK | |
207 | ||
208 | ||
209 | case 19: | |
210 | YY_RULE_SETUP | |
211 | -#line 151 "scan.l" | |
212 | +#line 167 "scan.l" | |
213 | ACTION_ECHO; yy_pop_state(); | |
214 | YY_BREAK | |
215 | case 20: | |
216 | YY_RULE_SETUP | |
217 | -#line 152 "scan.l" | |
218 | +#line 168 "scan.l" | |
219 | ACTION_ECHO; | |
220 | YY_BREAK | |
221 | case 21: | |
222 | YY_RULE_SETUP | |
223 | -#line 153 "scan.l" | |
224 | +#line 169 "scan.l" | |
225 | ACTION_ECHO; | |
226 | YY_BREAK | |
227 | case 22: | |
228 | YY_RULE_SETUP | |
229 | -#line 154 "scan.l" | |
230 | +#line 170 "scan.l" | |
231 | ++linenum; ACTION_ECHO; | |
232 | YY_BREAK | |
233 | ||
234 | ||
235 | case 23: | |
236 | YY_RULE_SETUP | |
237 | -#line 158 "scan.l" | |
238 | +#line 174 "scan.l" | |
239 | yy_pop_state(); | |
240 | YY_BREAK | |
241 | case 24: | |
242 | YY_RULE_SETUP | |
243 | -#line 159 "scan.l" | |
244 | +#line 175 "scan.l" | |
245 | linenum = myctoi( yytext ); | |
246 | YY_BREAK | |
247 | case 25: | |
248 | YY_RULE_SETUP | |
249 | -#line 161 "scan.l" | |
250 | +#line 177 "scan.l" | |
251 | { | |
252 | flex_free( (void *) infilename ); | |
253 | infilename = copy_string( yytext + 1 ); | |
254 | @@ -1729,24 +1757,24 @@ | |
255 | YY_BREAK | |
256 | case 26: | |
257 | YY_RULE_SETUP | |
258 | -#line 166 "scan.l" | |
259 | +#line 182 "scan.l" | |
260 | /* ignore spurious characters */ | |
261 | YY_BREAK | |
262 | ||
263 | ||
264 | case 27: | |
265 | YY_RULE_SETUP | |
266 | -#line 170 "scan.l" | |
267 | +#line 186 "scan.l" | |
268 | ++linenum; BEGIN(INITIAL); | |
269 | YY_BREAK | |
270 | case 28: | |
271 | YY_RULE_SETUP | |
272 | -#line 172 "scan.l" | |
273 | +#line 188 "scan.l" | |
274 | ACTION_ECHO; | |
275 | YY_BREAK | |
276 | case 29: | |
277 | YY_RULE_SETUP | |
278 | -#line 174 "scan.l" | |
279 | +#line 190 "scan.l" | |
280 | { | |
281 | ++linenum; | |
282 | ACTION_ECHO; | |
283 | @@ -1758,14 +1786,24 @@ | |
284 | ||
285 | case 30: | |
286 | YY_RULE_SETUP | |
287 | -#line 184 "scan.l" | |
288 | +#line 200 "scan.l" | |
289 | /* separates name and definition */ | |
290 | YY_BREAK | |
291 | case 31: | |
292 | YY_RULE_SETUP | |
293 | -#line 186 "scan.l" | |
294 | +#line 202 "scan.l" | |
295 | +{ | |
296 | + if(strlen(yytext) < MAXLINE) | |
297 | { | |
298 | strcpy( (char *) nmdef, yytext ); | |
299 | + } | |
300 | + else | |
301 | + { | |
302 | + fputs("Input line too long!\n", stderr); | |
303 | + exit(1); | |
304 | + } /* end of else */ | |
305 | + | |
306 | + | |
307 | ||
308 | /* Skip trailing whitespace. */ | |
309 | for ( i = strlen( (char *) nmdef ) - 1; | |
310 | @@ -1781,7 +1819,7 @@ | |
311 | YY_BREAK | |
312 | case 32: | |
313 | YY_RULE_SETUP | |
314 | -#line 201 "scan.l" | |
315 | +#line 227 "scan.l" | |
316 | { | |
317 | if ( ! didadef ) | |
318 | synerr( _( "incomplete name definition" ) ); | |
319 | @@ -1793,94 +1831,94 @@ | |
320 | ||
321 | case 33: | |
322 | YY_RULE_SETUP | |
323 | -#line 211 "scan.l" | |
324 | +#line 237 "scan.l" | |
325 | ++linenum; BEGIN(INITIAL); | |
326 | YY_BREAK | |
327 | case 34: | |
328 | YY_RULE_SETUP | |
329 | -#line 212 "scan.l" | |
330 | +#line 238 "scan.l" | |
331 | option_sense = true; | |
332 | YY_BREAK | |
333 | case 35: | |
334 | YY_RULE_SETUP | |
335 | -#line 214 "scan.l" | |
336 | +#line 240 "scan.l" | |
337 | return '='; | |
338 | YY_BREAK | |
339 | case 36: | |
340 | YY_RULE_SETUP | |
341 | -#line 216 "scan.l" | |
342 | +#line 242 "scan.l" | |
343 | option_sense = ! option_sense; | |
344 | YY_BREAK | |
345 | case 37: | |
346 | YY_RULE_SETUP | |
347 | -#line 218 "scan.l" | |
348 | +#line 244 "scan.l" | |
349 | csize = option_sense ? 128 : 256; | |
350 | YY_BREAK | |
351 | case 38: | |
352 | YY_RULE_SETUP | |
353 | -#line 219 "scan.l" | |
354 | +#line 245 "scan.l" | |
355 | csize = option_sense ? 256 : 128; | |
356 | YY_BREAK | |
357 | case 39: | |
358 | YY_RULE_SETUP | |
359 | -#line 221 "scan.l" | |
360 | +#line 247 "scan.l" | |
361 | long_align = option_sense; | |
362 | YY_BREAK | |
363 | case 40: | |
364 | YY_RULE_SETUP | |
365 | -#line 222 "scan.l" | |
366 | +#line 248 "scan.l" | |
367 | { | |
368 | action_define( "YY_ALWAYS_INTERACTIVE", option_sense ); | |
369 | } | |
370 | YY_BREAK | |
371 | case 41: | |
372 | YY_RULE_SETUP | |
373 | -#line 225 "scan.l" | |
374 | +#line 251 "scan.l" | |
375 | yytext_is_array = option_sense; | |
376 | YY_BREAK | |
377 | case 42: | |
378 | YY_RULE_SETUP | |
379 | -#line 226 "scan.l" | |
380 | +#line 252 "scan.l" | |
381 | backing_up_report = option_sense; | |
382 | YY_BREAK | |
383 | case 43: | |
384 | YY_RULE_SETUP | |
385 | -#line 227 "scan.l" | |
386 | +#line 253 "scan.l" | |
387 | interactive = ! option_sense; | |
388 | YY_BREAK | |
389 | case 44: | |
390 | YY_RULE_SETUP | |
391 | -#line 228 "scan.l" | |
392 | +#line 254 "scan.l" | |
393 | C_plus_plus = option_sense; | |
394 | YY_BREAK | |
395 | case 45: | |
396 | YY_RULE_SETUP | |
397 | -#line 229 "scan.l" | |
398 | +#line 255 "scan.l" | |
399 | caseins = ! option_sense; | |
400 | YY_BREAK | |
401 | case 46: | |
402 | YY_RULE_SETUP | |
403 | -#line 230 "scan.l" | |
404 | +#line 256 "scan.l" | |
405 | caseins = option_sense; | |
406 | YY_BREAK | |
407 | case 47: | |
408 | YY_RULE_SETUP | |
409 | -#line 231 "scan.l" | |
410 | +#line 257 "scan.l" | |
411 | ddebug = option_sense; | |
412 | YY_BREAK | |
413 | case 48: | |
414 | YY_RULE_SETUP | |
415 | -#line 232 "scan.l" | |
416 | +#line 258 "scan.l" | |
417 | spprdflt = ! option_sense; | |
418 | YY_BREAK | |
419 | case 49: | |
420 | YY_RULE_SETUP | |
421 | -#line 233 "scan.l" | |
422 | +#line 259 "scan.l" | |
423 | useecs = option_sense; | |
424 | YY_BREAK | |
425 | case 50: | |
426 | YY_RULE_SETUP | |
427 | -#line 234 "scan.l" | |
428 | +#line 260 "scan.l" | |
429 | { | |
430 | useecs = usemecs = false; | |
431 | use_read = fullspd = true; | |
432 | @@ -1888,7 +1926,7 @@ | |
433 | YY_BREAK | |
434 | case 51: | |
435 | YY_RULE_SETUP | |
436 | -#line 238 "scan.l" | |
437 | +#line 264 "scan.l" | |
438 | { | |
439 | useecs = usemecs = false; | |
440 | use_read = fulltbl = true; | |
441 | @@ -1896,22 +1934,22 @@ | |
442 | YY_BREAK | |
443 | case 52: | |
444 | YY_RULE_SETUP | |
445 | -#line 242 "scan.l" | |
446 | +#line 268 "scan.l" | |
447 | ACTION_IFDEF("YY_NO_INPUT", ! option_sense); | |
448 | YY_BREAK | |
449 | case 53: | |
450 | YY_RULE_SETUP | |
451 | -#line 243 "scan.l" | |
452 | +#line 269 "scan.l" | |
453 | interactive = option_sense; | |
454 | YY_BREAK | |
455 | case 54: | |
456 | YY_RULE_SETUP | |
457 | -#line 244 "scan.l" | |
458 | +#line 270 "scan.l" | |
459 | lex_compat = option_sense; | |
460 | YY_BREAK | |
461 | case 55: | |
462 | YY_RULE_SETUP | |
463 | -#line 245 "scan.l" | |
464 | +#line 271 "scan.l" | |
465 | { | |
466 | action_define( "YY_MAIN", option_sense ); | |
467 | do_yywrap = ! option_sense; | |
468 | @@ -1919,138 +1957,146 @@ | |
469 | YY_BREAK | |
470 | case 56: | |
471 | YY_RULE_SETUP | |
472 | -#line 249 "scan.l" | |
473 | +#line 275 "scan.l" | |
474 | usemecs = option_sense; | |
475 | YY_BREAK | |
476 | case 57: | |
477 | YY_RULE_SETUP | |
478 | -#line 250 "scan.l" | |
479 | +#line 276 "scan.l" | |
480 | { | |
481 | action_define( "YY_NEVER_INTERACTIVE", option_sense ); | |
482 | } | |
483 | YY_BREAK | |
484 | case 58: | |
485 | YY_RULE_SETUP | |
486 | -#line 253 "scan.l" | |
487 | +#line 279 "scan.l" | |
488 | performance_report += option_sense ? 1 : -1; | |
489 | YY_BREAK | |
490 | case 59: | |
491 | YY_RULE_SETUP | |
492 | -#line 254 "scan.l" | |
493 | +#line 280 "scan.l" | |
494 | yytext_is_array = ! option_sense; | |
495 | YY_BREAK | |
496 | case 60: | |
497 | YY_RULE_SETUP | |
498 | -#line 255 "scan.l" | |
499 | +#line 281 "scan.l" | |
500 | use_read = option_sense; | |
501 | YY_BREAK | |
502 | case 61: | |
503 | YY_RULE_SETUP | |
504 | -#line 256 "scan.l" | |
505 | +#line 282 "scan.l" | |
506 | reject_really_used = option_sense; | |
507 | YY_BREAK | |
508 | case 62: | |
509 | YY_RULE_SETUP | |
510 | -#line 257 "scan.l" | |
511 | +#line 283 "scan.l" | |
512 | action_define( "YY_STACK_USED", option_sense ); | |
513 | YY_BREAK | |
514 | case 63: | |
515 | YY_RULE_SETUP | |
516 | -#line 258 "scan.l" | |
517 | +#line 284 "scan.l" | |
518 | do_stdinit = option_sense; | |
519 | YY_BREAK | |
520 | case 64: | |
521 | YY_RULE_SETUP | |
522 | -#line 259 "scan.l" | |
523 | +#line 285 "scan.l" | |
524 | use_stdout = option_sense; | |
525 | YY_BREAK | |
526 | case 65: | |
527 | YY_RULE_SETUP | |
528 | -#line 260 "scan.l" | |
529 | +#line 286 "scan.l" | |
530 | ACTION_IFDEF("YY_NO_UNPUT", ! option_sense); | |
531 | YY_BREAK | |
532 | case 66: | |
533 | YY_RULE_SETUP | |
534 | -#line 261 "scan.l" | |
535 | +#line 287 "scan.l" | |
536 | printstats = option_sense; | |
537 | YY_BREAK | |
538 | case 67: | |
539 | YY_RULE_SETUP | |
540 | -#line 262 "scan.l" | |
541 | +#line 288 "scan.l" | |
542 | nowarn = ! option_sense; | |
543 | YY_BREAK | |
544 | case 68: | |
545 | YY_RULE_SETUP | |
546 | -#line 263 "scan.l" | |
547 | +#line 289 "scan.l" | |
548 | do_yylineno = option_sense; | |
549 | YY_BREAK | |
550 | case 69: | |
551 | YY_RULE_SETUP | |
552 | -#line 264 "scan.l" | |
553 | +#line 290 "scan.l" | |
554 | yymore_really_used = option_sense; | |
555 | YY_BREAK | |
556 | case 70: | |
557 | YY_RULE_SETUP | |
558 | -#line 265 "scan.l" | |
559 | +#line 291 "scan.l" | |
560 | do_yywrap = option_sense; | |
561 | YY_BREAK | |
562 | case 71: | |
563 | YY_RULE_SETUP | |
564 | -#line 267 "scan.l" | |
565 | +#line 293 "scan.l" | |
566 | ACTION_IFDEF("YY_NO_PUSH_STATE", ! option_sense); | |
567 | YY_BREAK | |
568 | case 72: | |
569 | YY_RULE_SETUP | |
570 | -#line 268 "scan.l" | |
571 | +#line 294 "scan.l" | |
572 | ACTION_IFDEF("YY_NO_POP_STATE", ! option_sense); | |
573 | YY_BREAK | |
574 | case 73: | |
575 | YY_RULE_SETUP | |
576 | -#line 269 "scan.l" | |
577 | +#line 295 "scan.l" | |
578 | ACTION_IFDEF("YY_NO_TOP_STATE", ! option_sense); | |
579 | YY_BREAK | |
580 | case 74: | |
581 | YY_RULE_SETUP | |
582 | -#line 271 "scan.l" | |
583 | +#line 297 "scan.l" | |
584 | ACTION_IFDEF("YY_NO_SCAN_BUFFER", ! option_sense); | |
585 | YY_BREAK | |
586 | case 75: | |
587 | YY_RULE_SETUP | |
588 | -#line 272 "scan.l" | |
589 | +#line 298 "scan.l" | |
590 | ACTION_IFDEF("YY_NO_SCAN_BYTES", ! option_sense); | |
591 | YY_BREAK | |
592 | case 76: | |
593 | YY_RULE_SETUP | |
594 | -#line 273 "scan.l" | |
595 | +#line 299 "scan.l" | |
596 | ACTION_IFDEF("YY_NO_SCAN_STRING", ! option_sense); | |
597 | YY_BREAK | |
598 | case 77: | |
599 | YY_RULE_SETUP | |
600 | -#line 275 "scan.l" | |
601 | +#line 301 "scan.l" | |
602 | return OPT_OUTFILE; | |
603 | YY_BREAK | |
604 | case 78: | |
605 | YY_RULE_SETUP | |
606 | -#line 276 "scan.l" | |
607 | +#line 302 "scan.l" | |
608 | return OPT_PREFIX; | |
609 | YY_BREAK | |
610 | case 79: | |
611 | YY_RULE_SETUP | |
612 | -#line 277 "scan.l" | |
613 | +#line 303 "scan.l" | |
614 | return OPT_YYCLASS; | |
615 | YY_BREAK | |
616 | case 80: | |
617 | YY_RULE_SETUP | |
618 | -#line 279 "scan.l" | |
619 | +#line 305 "scan.l" | |
620 | +{ | |
621 | + if(strlen(yytext + 1 ) < MAXLINE) | |
622 | { | |
623 | strcpy( nmstr, yytext + 1 ); | |
624 | + } | |
625 | + else | |
626 | + { | |
627 | + fputs("Input line too long!\n", stderr); | |
628 | + exit(1); | |
629 | + } /* end of else */ | |
630 | nmstr[strlen( nmstr ) - 1] = '\0'; | |
631 | return NAME; | |
632 | } | |
633 | YY_BREAK | |
634 | case 81: | |
635 | YY_RULE_SETUP | |
636 | -#line 285 "scan.l" | |
637 | +#line 319 "scan.l" | |
638 | { | |
639 | format_synerr( _( "unrecognized %%option: %s" ), | |
640 | yytext ); | |
641 | @@ -2060,28 +2106,28 @@ | |
642 | ||
643 | case 82: | |
644 | YY_RULE_SETUP | |
645 | -#line 292 "scan.l" | |
646 | +#line 326 "scan.l" | |
647 | ++linenum; BEGIN(INITIAL); | |
648 | YY_BREAK | |
649 | ||
650 | case 83: | |
651 | YY_RULE_SETUP | |
652 | -#line 296 "scan.l" | |
653 | +#line 330 "scan.l" | |
654 | ++bracelevel; yyless( 2 ); /* eat only %{ */ | |
655 | YY_BREAK | |
656 | case 84: | |
657 | YY_RULE_SETUP | |
658 | -#line 297 "scan.l" | |
659 | +#line 331 "scan.l" | |
660 | --bracelevel; yyless( 2 ); /* eat only %} */ | |
661 | YY_BREAK | |
662 | case 85: | |
663 | YY_RULE_SETUP | |
664 | -#line 299 "scan.l" | |
665 | +#line 333 "scan.l" | |
666 | ACTION_ECHO; /* indented code in prolog */ | |
667 | YY_BREAK | |
668 | case 86: | |
669 | YY_RULE_SETUP | |
670 | -#line 301 "scan.l" | |
671 | +#line 335 "scan.l" | |
672 | { /* non-indented code */ | |
673 | if ( bracelevel <= 0 ) | |
674 | { /* not in %{ ... %} */ | |
675 | @@ -2096,16 +2142,16 @@ | |
676 | YY_BREAK | |
677 | case 87: | |
678 | YY_RULE_SETUP | |
679 | -#line 313 "scan.l" | |
680 | +#line 347 "scan.l" | |
681 | ACTION_ECHO; | |
682 | YY_BREAK | |
683 | case 88: | |
684 | YY_RULE_SETUP | |
685 | -#line 314 "scan.l" | |
686 | +#line 348 "scan.l" | |
687 | ++linenum; ACTION_ECHO; | |
688 | YY_BREAK | |
689 | case YY_STATE_EOF(SECT2PROLOG): | |
690 | -#line 316 "scan.l" | |
691 | +#line 350 "scan.l" | |
692 | { | |
693 | mark_prolog(); | |
694 | sectnum = 0; | |
695 | @@ -2116,12 +2162,12 @@ | |
696 | ||
697 | case 89: | |
698 | YY_RULE_SETUP | |
699 | -#line 324 "scan.l" | |
700 | +#line 358 "scan.l" | |
701 | ++linenum; /* allow blank lines in section 2 */ | |
702 | YY_BREAK | |
703 | case 90: | |
704 | YY_RULE_SETUP | |
705 | -#line 326 "scan.l" | |
706 | +#line 360 "scan.l" | |
707 | { | |
708 | indented_code = false; | |
709 | doing_codeblock = true; | |
710 | @@ -2131,17 +2177,17 @@ | |
711 | YY_BREAK | |
712 | case 91: | |
713 | YY_RULE_SETUP | |
714 | -#line 333 "scan.l" | |
715 | +#line 367 "scan.l" | |
716 | BEGIN(SC); return '<'; | |
717 | YY_BREAK | |
718 | case 92: | |
719 | YY_RULE_SETUP | |
720 | -#line 334 "scan.l" | |
721 | +#line 368 "scan.l" | |
722 | return '^'; | |
723 | YY_BREAK | |
724 | case 93: | |
725 | YY_RULE_SETUP | |
726 | -#line 335 "scan.l" | |
727 | +#line 369 "scan.l" | |
728 | BEGIN(QUOTE); return '"'; | |
729 | YY_BREAK | |
730 | case 94: | |
731 | @@ -2149,7 +2195,7 @@ | |
732 | yy_c_buf_p = yy_cp = yy_bp + 1; | |
733 | YY_DO_BEFORE_ACTION; /* set up yytext again */ | |
734 | YY_RULE_SETUP | |
735 | -#line 336 "scan.l" | |
736 | +#line 370 "scan.l" | |
737 | BEGIN(NUM); return '{'; | |
738 | YY_BREAK | |
739 | case 95: | |
740 | @@ -2157,12 +2203,12 @@ | |
741 | yy_c_buf_p = yy_cp = yy_bp + 1; | |
742 | YY_DO_BEFORE_ACTION; /* set up yytext again */ | |
743 | YY_RULE_SETUP | |
744 | -#line 337 "scan.l" | |
745 | +#line 371 "scan.l" | |
746 | return '$'; | |
747 | YY_BREAK | |
748 | case 96: | |
749 | YY_RULE_SETUP | |
750 | -#line 339 "scan.l" | |
751 | +#line 373 "scan.l" | |
752 | { | |
753 | bracelevel = 1; | |
754 | BEGIN(PERCENT_BRACE_ACTION); | |
755 | @@ -2177,12 +2223,12 @@ | |
756 | YY_BREAK | |
757 | case 97: | |
758 | YY_RULE_SETUP | |
759 | -#line 350 "scan.l" | |
760 | +#line 384 "scan.l" | |
761 | continued_action = true; ++linenum; return '\n'; | |
762 | YY_BREAK | |
763 | case 98: | |
764 | YY_RULE_SETUP | |
765 | -#line 352 "scan.l" | |
766 | +#line 386 "scan.l" | |
767 | { | |
768 | yyless( yyleng - 2 ); /* put back '/', '*' */ | |
769 | bracelevel = 0; | |
770 | @@ -2192,12 +2238,12 @@ | |
771 | YY_BREAK | |
772 | case 99: | |
773 | YY_RULE_SETUP | |
774 | -#line 359 "scan.l" | |
775 | +#line 393 "scan.l" | |
776 | /* allow indented rules */ | |
777 | YY_BREAK | |
778 | case 100: | |
779 | YY_RULE_SETUP | |
780 | -#line 361 "scan.l" | |
781 | +#line 395 "scan.l" | |
782 | { | |
783 | /* This rule is separate from the one below because | |
784 | * otherwise we get variable trailing context, so | |
785 | @@ -2217,7 +2263,7 @@ | |
786 | YY_BREAK | |
787 | case 101: | |
788 | YY_RULE_SETUP | |
789 | -#line 378 "scan.l" | |
790 | +#line 412 "scan.l" | |
791 | { | |
792 | bracelevel = 0; | |
793 | continued_action = false; | |
794 | @@ -2233,15 +2279,15 @@ | |
795 | } | |
796 | YY_BREAK | |
797 | case 102: | |
798 | -#line 393 "scan.l" | |
799 | +#line 427 "scan.l" | |
800 | case 103: | |
801 | YY_RULE_SETUP | |
802 | -#line 393 "scan.l" | |
803 | +#line 427 "scan.l" | |
804 | return EOF_OP; | |
805 | YY_BREAK | |
806 | case 104: | |
807 | YY_RULE_SETUP | |
808 | -#line 395 "scan.l" | |
809 | +#line 429 "scan.l" | |
810 | { | |
811 | sectnum = 3; | |
812 | BEGIN(SECT3); | |
813 | @@ -2250,11 +2296,19 @@ | |
814 | YY_BREAK | |
815 | case 105: | |
816 | YY_RULE_SETUP | |
817 | -#line 401 "scan.l" | |
818 | +#line 435 "scan.l" | |
819 | { | |
820 | int cclval; | |
821 | ||
822 | + if(strlen(yytext ) < MAXLINE) | |
823 | + { | |
824 | strcpy( nmstr, yytext ); | |
825 | + } | |
826 | + else | |
827 | + { | |
828 | + fputs("Input line too long!\n", stderr); | |
829 | + exit(1); | |
830 | + } | |
831 | ||
832 | /* Check to see if we've already encountered this | |
833 | * ccl. | |
834 | @@ -2287,12 +2341,20 @@ | |
835 | YY_BREAK | |
836 | case 106: | |
837 | YY_RULE_SETUP | |
838 | -#line 435 "scan.l" | |
839 | +#line 477 "scan.l" | |
840 | { | |
841 | register Char *nmdefptr; | |
842 | Char *ndlookup(); | |
843 | ||
844 | + if(strlen(yytext + 1 ) < MAXLINE) | |
845 | + { | |
846 | strcpy( nmstr, yytext + 1 ); | |
847 | + } | |
848 | + else | |
849 | + { | |
850 | + fputs("Input line too long!\n", stderr); | |
851 | + exit(1); | |
852 | + } /* end of else */ | |
853 | nmstr[yyleng - 2] = '\0'; /* chop trailing brace */ | |
854 | ||
855 | if ( (nmdefptr = ndlookup( nmstr )) == 0 ) | |
856 | @@ -2324,24 +2386,24 @@ | |
857 | YY_BREAK | |
858 | case 107: | |
859 | YY_RULE_SETUP | |
860 | -#line 469 "scan.l" | |
861 | +#line 519 "scan.l" | |
862 | return (unsigned char) yytext[0]; | |
863 | YY_BREAK | |
864 | case 108: | |
865 | YY_RULE_SETUP | |
866 | -#line 470 "scan.l" | |
867 | +#line 520 "scan.l" | |
868 | RETURNCHAR; | |
869 | YY_BREAK | |
870 | ||
871 | ||
872 | case 109: | |
873 | YY_RULE_SETUP | |
874 | -#line 475 "scan.l" | |
875 | +#line 525 "scan.l" | |
876 | return (unsigned char) yytext[0]; | |
877 | YY_BREAK | |
878 | case 110: | |
879 | YY_RULE_SETUP | |
880 | -#line 476 "scan.l" | |
881 | +#line 526 "scan.l" | |
882 | BEGIN(SECT2); return '>'; | |
883 | YY_BREAK | |
884 | case 111: | |
885 | @@ -2349,17 +2411,17 @@ | |
886 | yy_c_buf_p = yy_cp = yy_bp + 1; | |
887 | YY_DO_BEFORE_ACTION; /* set up yytext again */ | |
888 | YY_RULE_SETUP | |
889 | -#line 477 "scan.l" | |
890 | +#line 527 "scan.l" | |
891 | BEGIN(CARETISBOL); return '>'; | |
892 | YY_BREAK | |
893 | case 112: | |
894 | YY_RULE_SETUP | |
895 | -#line 478 "scan.l" | |
896 | +#line 528 "scan.l" | |
897 | RETURNNAME; | |
898 | YY_BREAK | |
899 | case 113: | |
900 | YY_RULE_SETUP | |
901 | -#line 479 "scan.l" | |
902 | +#line 529 "scan.l" | |
903 | { | |
904 | format_synerr( _( "bad <start condition>: %s" ), | |
905 | yytext ); | |
906 | @@ -2368,23 +2430,23 @@ | |
907 | ||
908 | case 114: | |
909 | YY_RULE_SETUP | |
910 | -#line 485 "scan.l" | |
911 | +#line 535 "scan.l" | |
912 | BEGIN(SECT2); return '^'; | |
913 | YY_BREAK | |
914 | ||
915 | case 115: | |
916 | YY_RULE_SETUP | |
917 | -#line 489 "scan.l" | |
918 | +#line 539 "scan.l" | |
919 | RETURNCHAR; | |
920 | YY_BREAK | |
921 | case 116: | |
922 | YY_RULE_SETUP | |
923 | -#line 490 "scan.l" | |
924 | +#line 540 "scan.l" | |
925 | BEGIN(SECT2); return '"'; | |
926 | YY_BREAK | |
927 | case 117: | |
928 | YY_RULE_SETUP | |
929 | -#line 492 "scan.l" | |
930 | +#line 542 "scan.l" | |
931 | { | |
932 | synerr( _( "missing quote" ) ); | |
933 | BEGIN(SECT2); | |
934 | @@ -2399,7 +2461,7 @@ | |
935 | yy_c_buf_p = yy_cp = yy_bp + 1; | |
936 | YY_DO_BEFORE_ACTION; /* set up yytext again */ | |
937 | YY_RULE_SETUP | |
938 | -#line 502 "scan.l" | |
939 | +#line 552 "scan.l" | |
940 | BEGIN(CCL); return '^'; | |
941 | YY_BREAK | |
942 | case 119: | |
943 | @@ -2407,12 +2469,12 @@ | |
944 | yy_c_buf_p = yy_cp = yy_bp + 1; | |
945 | YY_DO_BEFORE_ACTION; /* set up yytext again */ | |
946 | YY_RULE_SETUP | |
947 | -#line 503 "scan.l" | |
948 | +#line 553 "scan.l" | |
949 | return '^'; | |
950 | YY_BREAK | |
951 | case 120: | |
952 | YY_RULE_SETUP | |
953 | -#line 504 "scan.l" | |
954 | +#line 554 "scan.l" | |
955 | BEGIN(CCL); RETURNCHAR; | |
956 | YY_BREAK | |
957 | ||
958 | @@ -2422,22 +2484,22 @@ | |
959 | yy_c_buf_p = yy_cp = yy_bp + 1; | |
960 | YY_DO_BEFORE_ACTION; /* set up yytext again */ | |
961 | YY_RULE_SETUP | |
962 | -#line 508 "scan.l" | |
963 | +#line 558 "scan.l" | |
964 | return '-'; | |
965 | YY_BREAK | |
966 | case 122: | |
967 | YY_RULE_SETUP | |
968 | -#line 509 "scan.l" | |
969 | +#line 559 "scan.l" | |
970 | RETURNCHAR; | |
971 | YY_BREAK | |
972 | case 123: | |
973 | YY_RULE_SETUP | |
974 | -#line 510 "scan.l" | |
975 | +#line 560 "scan.l" | |
976 | BEGIN(SECT2); return ']'; | |
977 | YY_BREAK | |
978 | case 124: | |
979 | YY_RULE_SETUP | |
980 | -#line 511 "scan.l" | |
981 | +#line 561 "scan.l" | |
982 | { | |
983 | synerr( _( "bad character class" ) ); | |
984 | BEGIN(SECT2); | |
985 | @@ -2448,67 +2510,67 @@ | |
986 | ||
987 | case 125: | |
988 | YY_RULE_SETUP | |
989 | -#line 519 "scan.l" | |
990 | +#line 569 "scan.l" | |
991 | BEGIN(CCL); return CCE_ALNUM; | |
992 | YY_BREAK | |
993 | case 126: | |
994 | YY_RULE_SETUP | |
995 | -#line 520 "scan.l" | |
996 | +#line 570 "scan.l" | |
997 | BEGIN(CCL); return CCE_ALPHA; | |
998 | YY_BREAK | |
999 | case 127: | |
1000 | YY_RULE_SETUP | |
1001 | -#line 521 "scan.l" | |
1002 | +#line 571 "scan.l" | |
1003 | BEGIN(CCL); return CCE_BLANK; | |
1004 | YY_BREAK | |
1005 | case 128: | |
1006 | YY_RULE_SETUP | |
1007 | -#line 522 "scan.l" | |
1008 | +#line 572 "scan.l" | |
1009 | BEGIN(CCL); return CCE_CNTRL; | |
1010 | YY_BREAK | |
1011 | case 129: | |
1012 | YY_RULE_SETUP | |
1013 | -#line 523 "scan.l" | |
1014 | +#line 573 "scan.l" | |
1015 | BEGIN(CCL); return CCE_DIGIT; | |
1016 | YY_BREAK | |
1017 | case 130: | |
1018 | YY_RULE_SETUP | |
1019 | -#line 524 "scan.l" | |
1020 | +#line 574 "scan.l" | |
1021 | BEGIN(CCL); return CCE_GRAPH; | |
1022 | YY_BREAK | |
1023 | case 131: | |
1024 | YY_RULE_SETUP | |
1025 | -#line 525 "scan.l" | |
1026 | +#line 575 "scan.l" | |
1027 | BEGIN(CCL); return CCE_LOWER; | |
1028 | YY_BREAK | |
1029 | case 132: | |
1030 | YY_RULE_SETUP | |
1031 | -#line 526 "scan.l" | |
1032 | +#line 576 "scan.l" | |
1033 | BEGIN(CCL); return CCE_PRINT; | |
1034 | YY_BREAK | |
1035 | case 133: | |
1036 | YY_RULE_SETUP | |
1037 | -#line 527 "scan.l" | |
1038 | +#line 577 "scan.l" | |
1039 | BEGIN(CCL); return CCE_PUNCT; | |
1040 | YY_BREAK | |
1041 | case 134: | |
1042 | YY_RULE_SETUP | |
1043 | -#line 528 "scan.l" | |
1044 | +#line 578 "scan.l" | |
1045 | BEGIN(CCL); return CCE_SPACE; | |
1046 | YY_BREAK | |
1047 | case 135: | |
1048 | YY_RULE_SETUP | |
1049 | -#line 529 "scan.l" | |
1050 | +#line 579 "scan.l" | |
1051 | BEGIN(CCL); return CCE_UPPER; | |
1052 | YY_BREAK | |
1053 | case 136: | |
1054 | YY_RULE_SETUP | |
1055 | -#line 530 "scan.l" | |
1056 | +#line 580 "scan.l" | |
1057 | BEGIN(CCL); return CCE_XDIGIT; | |
1058 | YY_BREAK | |
1059 | case 137: | |
1060 | YY_RULE_SETUP | |
1061 | -#line 531 "scan.l" | |
1062 | +#line 581 "scan.l" | |
1063 | { | |
1064 | format_synerr( | |
1065 | _( "bad character class expression: %s" ), | |
1066 | @@ -2520,7 +2582,7 @@ | |
1067 | ||
1068 | case 138: | |
1069 | YY_RULE_SETUP | |
1070 | -#line 540 "scan.l" | |
1071 | +#line 590 "scan.l" | |
1072 | { | |
1073 | yylval = myctoi( yytext ); | |
1074 | return NUMBER; | |
1075 | @@ -2528,17 +2590,17 @@ | |
1076 | YY_BREAK | |
1077 | case 139: | |
1078 | YY_RULE_SETUP | |
1079 | -#line 545 "scan.l" | |
1080 | +#line 595 "scan.l" | |
1081 | return ','; | |
1082 | YY_BREAK | |
1083 | case 140: | |
1084 | YY_RULE_SETUP | |
1085 | -#line 546 "scan.l" | |
1086 | +#line 596 "scan.l" | |
1087 | BEGIN(SECT2); return '}'; | |
1088 | YY_BREAK | |
1089 | case 141: | |
1090 | YY_RULE_SETUP | |
1091 | -#line 548 "scan.l" | |
1092 | +#line 598 "scan.l" | |
1093 | { | |
1094 | synerr( _( "bad character inside {}'s" ) ); | |
1095 | BEGIN(SECT2); | |
1096 | @@ -2547,7 +2609,7 @@ | |
1097 | YY_BREAK | |
1098 | case 142: | |
1099 | YY_RULE_SETUP | |
1100 | -#line 554 "scan.l" | |
1101 | +#line 604 "scan.l" | |
1102 | { | |
1103 | synerr( _( "missing }" ) ); | |
1104 | BEGIN(SECT2); | |
1105 | @@ -2559,18 +2621,18 @@ | |
1106 | ||
1107 | case 143: | |
1108 | YY_RULE_SETUP | |
1109 | -#line 564 "scan.l" | |
1110 | +#line 614 "scan.l" | |
1111 | bracelevel = 0; | |
1112 | YY_BREAK | |
1113 | case 144: | |
1114 | YY_RULE_SETUP | |
1115 | -#line 566 "scan.l" | |
1116 | +#line 616 "scan.l" | |
1117 | ACTION_ECHO; yy_push_state( COMMENT ); | |
1118 | YY_BREAK | |
1119 | ||
1120 | case 145: | |
1121 | YY_RULE_SETUP | |
1122 | -#line 569 "scan.l" | |
1123 | +#line 619 "scan.l" | |
1124 | { | |
1125 | ACTION_ECHO; | |
1126 | CHECK_REJECT(yytext); | |
1127 | @@ -2578,7 +2640,7 @@ | |
1128 | YY_BREAK | |
1129 | case 146: | |
1130 | YY_RULE_SETUP | |
1131 | -#line 573 "scan.l" | |
1132 | +#line 623 "scan.l" | |
1133 | { | |
1134 | ACTION_ECHO; | |
1135 | CHECK_YYMORE(yytext); | |
1136 | @@ -2587,12 +2649,12 @@ | |
1137 | ||
1138 | case 147: | |
1139 | YY_RULE_SETUP | |
1140 | -#line 579 "scan.l" | |
1141 | +#line 629 "scan.l" | |
1142 | ACTION_ECHO; | |
1143 | YY_BREAK | |
1144 | case 148: | |
1145 | YY_RULE_SETUP | |
1146 | -#line 580 "scan.l" | |
1147 | +#line 630 "scan.l" | |
1148 | { | |
1149 | ++linenum; | |
1150 | ACTION_ECHO; | |
1151 | @@ -2612,37 +2674,37 @@ | |
1152 | ||
1153 | case 149: | |
1154 | YY_RULE_SETUP | |
1155 | -#line 598 "scan.l" | |
1156 | +#line 648 "scan.l" | |
1157 | ACTION_ECHO; ++bracelevel; | |
1158 | YY_BREAK | |
1159 | case 150: | |
1160 | YY_RULE_SETUP | |
1161 | -#line 599 "scan.l" | |
1162 | +#line 649 "scan.l" | |
1163 | ACTION_ECHO; --bracelevel; | |
1164 | YY_BREAK | |
1165 | case 151: | |
1166 | YY_RULE_SETUP | |
1167 | -#line 600 "scan.l" | |
1168 | +#line 650 "scan.l" | |
1169 | ACTION_ECHO; | |
1170 | YY_BREAK | |
1171 | case 152: | |
1172 | YY_RULE_SETUP | |
1173 | -#line 601 "scan.l" | |
1174 | +#line 651 "scan.l" | |
1175 | ACTION_ECHO; | |
1176 | YY_BREAK | |
1177 | case 153: | |
1178 | YY_RULE_SETUP | |
1179 | -#line 602 "scan.l" | |
1180 | +#line 652 "scan.l" | |
1181 | ACTION_ECHO; /* character constant */ | |
1182 | YY_BREAK | |
1183 | case 154: | |
1184 | YY_RULE_SETUP | |
1185 | -#line 603 "scan.l" | |
1186 | +#line 653 "scan.l" | |
1187 | ACTION_ECHO; BEGIN(ACTION_STRING); | |
1188 | YY_BREAK | |
1189 | case 155: | |
1190 | YY_RULE_SETUP | |
1191 | -#line 604 "scan.l" | |
1192 | +#line 654 "scan.l" | |
1193 | { | |
1194 | ++linenum; | |
1195 | ACTION_ECHO; | |
1196 | @@ -2658,41 +2720,41 @@ | |
1197 | YY_BREAK | |
1198 | case 156: | |
1199 | YY_RULE_SETUP | |
1200 | -#line 616 "scan.l" | |
1201 | +#line 666 "scan.l" | |
1202 | ACTION_ECHO; | |
1203 | YY_BREAK | |
1204 | ||
1205 | ||
1206 | case 157: | |
1207 | YY_RULE_SETUP | |
1208 | -#line 620 "scan.l" | |
1209 | +#line 670 "scan.l" | |
1210 | ACTION_ECHO; | |
1211 | YY_BREAK | |
1212 | case 158: | |
1213 | YY_RULE_SETUP | |
1214 | -#line 621 "scan.l" | |
1215 | +#line 671 "scan.l" | |
1216 | ACTION_ECHO; | |
1217 | YY_BREAK | |
1218 | case 159: | |
1219 | YY_RULE_SETUP | |
1220 | -#line 622 "scan.l" | |
1221 | +#line 672 "scan.l" | |
1222 | ++linenum; ACTION_ECHO; | |
1223 | YY_BREAK | |
1224 | case 160: | |
1225 | YY_RULE_SETUP | |
1226 | -#line 623 "scan.l" | |
1227 | +#line 673 "scan.l" | |
1228 | ACTION_ECHO; BEGIN(ACTION); | |
1229 | YY_BREAK | |
1230 | case 161: | |
1231 | YY_RULE_SETUP | |
1232 | -#line 624 "scan.l" | |
1233 | +#line 674 "scan.l" | |
1234 | ACTION_ECHO; | |
1235 | YY_BREAK | |
1236 | ||
1237 | case YY_STATE_EOF(COMMENT): | |
1238 | case YY_STATE_EOF(ACTION): | |
1239 | case YY_STATE_EOF(ACTION_STRING): | |
1240 | -#line 627 "scan.l" | |
1241 | +#line 677 "scan.l" | |
1242 | { | |
1243 | synerr( _( "EOF encountered inside an action" ) ); | |
1244 | yyterminate(); | |
1245 | @@ -2700,7 +2762,7 @@ | |
1246 | YY_BREAK | |
1247 | case 162: | |
1248 | YY_RULE_SETUP | |
1249 | -#line 633 "scan.l" | |
1250 | +#line 683 "scan.l" | |
1251 | { | |
1252 | yylval = myesc( (Char *) yytext ); | |
1253 | ||
1254 | @@ -2713,25 +2775,25 @@ | |
1255 | ||
1256 | case 163: | |
1257 | YY_RULE_SETUP | |
1258 | -#line 644 "scan.l" | |
1259 | +#line 694 "scan.l" | |
1260 | ECHO; | |
1261 | YY_BREAK | |
1262 | case YY_STATE_EOF(SECT3): | |
1263 | -#line 645 "scan.l" | |
1264 | +#line 695 "scan.l" | |
1265 | sectnum = 0; yyterminate(); | |
1266 | YY_BREAK | |
1267 | ||
1268 | case 164: | |
1269 | YY_RULE_SETUP | |
1270 | -#line 648 "scan.l" | |
1271 | +#line 698 "scan.l" | |
1272 | format_synerr( _( "bad character: %s" ), yytext ); | |
1273 | YY_BREAK | |
1274 | case 165: | |
1275 | YY_RULE_SETUP | |
1276 | -#line 650 "scan.l" | |
1277 | +#line 700 "scan.l" | |
1278 | YY_FATAL_ERROR( "flex scanner jammed" ); | |
1279 | YY_BREAK | |
1280 | -#line 2736 "scan.c" | |
1281 | +#line 2799 "scan.c" | |
1282 | case YY_STATE_EOF(INITIAL): | |
1283 | case YY_STATE_EOF(SECT2): | |
1284 | case YY_STATE_EOF(CODEBLOCK): | |
1285 | @@ -3626,7 +3688,7 @@ | |
1286 | return 0; | |
1287 | } | |
1288 | #endif | |
1289 | -#line 650 "scan.l" | |
1290 | +#line 700 "scan.l" | |
1291 | ||
1292 | ||
1293 | ||
1294 | diff -urN flex-2.5.4.orig/scan.l flex-2.5.4/scan.l | |
1295 | --- flex-2.5.4.orig/scan.l Sun Jul 27 04:44:13 1997 | |
1296 | +++ flex-2.5.4/scan.l Sat Sep 7 11:04:34 2002 | |
1297 | @@ -49,7 +49,15 @@ | |
1298 | return CHAR; | |
1299 | ||
1300 | #define RETURNNAME \ | |
1301 | + if(strlen(yytext) < MAXLINE) \ | |
1302 | + { \ | |
1303 | strcpy( nmstr, yytext ); \ | |
1304 | + } \ | |
1305 | + else \ | |
1306 | + { \ | |
1307 | + fputs("Input line too long!\n", stderr); \ | |
1308 | + exit(1); \ | |
1309 | + } /* end of else */ \ | |
1310 | return NAME; | |
1311 | ||
1312 | #define PUT_BACK_STRING(str, start) \ | |
1313 | @@ -136,7 +144,15 @@ | |
1314 | ^"%"[^sxaceknopr{}].* synerr( _( "unrecognized '%' directive" ) ); | |
1315 | ||
1316 | ^{NAME} { | |
1317 | + if(strlen(yytext) < MAXLINE) | |
1318 | + { | |
1319 | strcpy( nmstr, yytext ); | |
1320 | + } | |
1321 | + else | |
1322 | + { | |
1323 | + fputs("Input line too long!\n", stderr); | |
1324 | + exit(1); | |
1325 | + } /* end of else */ | |
1326 | didadef = false; | |
1327 | BEGIN(PICKUPDEF); | |
1328 | } | |
1329 | @@ -184,7 +200,17 @@ | |
1330 | {WS} /* separates name and definition */ | |
1331 | ||
1332 | {NOT_WS}.* { | |
1333 | + if(strlen(yytext) < MAXLINE) | |
1334 | + { | |
1335 | strcpy( (char *) nmdef, yytext ); | |
1336 | + } | |
1337 | + else | |
1338 | + { | |
1339 | + fputs("Input line too long!\n", stderr); | |
1340 | + exit(1); | |
1341 | + } /* end of else */ | |
1342 | + | |
1343 | + | |
1344 | ||
1345 | /* Skip trailing whitespace. */ | |
1346 | for ( i = strlen( (char *) nmdef ) - 1; | |
1347 | @@ -277,7 +303,15 @@ | |
1348 | yyclass return OPT_YYCLASS; | |
1349 | ||
1350 | \"[^"\n]*\" { | |
1351 | + if(strlen(yytext + 1 ) < MAXLINE) | |
1352 | + { | |
1353 | strcpy( nmstr, yytext + 1 ); | |
1354 | + } | |
1355 | + else | |
1356 | + { | |
1357 | + fputs("Input line too long!\n", stderr); | |
1358 | + exit(1); | |
1359 | + } /* end of else */ | |
1360 | nmstr[strlen( nmstr ) - 1] = '\0'; | |
1361 | return NAME; | |
1362 | } | |
1363 | @@ -401,7 +435,15 @@ | |
1364 | "["({FIRST_CCL_CHAR}|{CCL_EXPR})({CCL_CHAR}|{CCL_EXPR})* { | |
1365 | int cclval; | |
1366 | ||
1367 | + if(strlen(yytext ) < MAXLINE) | |
1368 | + { | |
1369 | strcpy( nmstr, yytext ); | |
1370 | + } | |
1371 | + else | |
1372 | + { | |
1373 | + fputs("Input line too long!\n", stderr); | |
1374 | + exit(1); | |
1375 | + } | |
1376 | ||
1377 | /* Check to see if we've already encountered this | |
1378 | * ccl. | |
1379 | @@ -436,7 +478,15 @@ | |
1380 | register Char *nmdefptr; | |
1381 | Char *ndlookup(); | |
1382 | ||
1383 | + if(strlen(yytext + 1 ) < MAXLINE) | |
1384 | + { | |
1385 | strcpy( nmstr, yytext + 1 ); | |
1386 | + } | |
1387 | + else | |
1388 | + { | |
1389 | + fputs("Input line too long!\n", stderr); | |
1390 | + exit(1); | |
1391 | + } /* end of else */ | |
1392 | nmstr[yyleng - 2] = '\0'; /* chop trailing brace */ | |
1393 | ||
1394 | if ( (nmdefptr = ndlookup( nmstr )) == 0 ) |