source:
patches/flex-2.5.31-debian_fixes-2.patch@
638ad56
Last change on this file since 638ad56 was 617118d, checked in by , 19 years ago | |
---|---|
|
|
File size: 8.8 KB |
-
flex-2.5.31
Submitted By: Zack Winkles <winkie@linuxfromscratch.org> Date: 2004-03-01 Initial Package Version: 2.5.31 Origin: Debian Description: This fixes a ton of things. I'm not entirely sure what, but it's all stuff that Debian thought to be broken, and I trust them. All the non-code changes have been stripped (otherwise it would be gargantuan). I've been using this patch for a few months now and it makes flex not suck anymore. That's a good thing. diff -Naur flex-2.5.31.orig/filter.c flex-2.5.31/filter.c
old new 157 157 if (chain->filter_func) { 158 158 int r; 159 159 160 /* setup streams again */ 160 /* setup streams again -- Removed. POSIX states that children inherit 161 open streams in the parent. Also, ANSI C99 states that the stdin 162 and stdout macors need not be modified lvalues; so this code is 163 broken in the first place. 161 164 if ((stdin = fdopen (0, "r")) == NULL) 162 165 flexfatal (_("fdopen(0) failed")); 163 166 if ((stdout = fdopen (1, "w")) == NULL) 164 167 flexfatal (_("fdopen(1) failed")); 168 */ 165 169 166 170 if ((r = chain->filter_func (chain)) == -1) 167 171 flexfatal (_("filter_func failed")); … … 181 185 if (dup2 (pipes[1], 1) == -1) 182 186 flexfatal (_("dup2(pipes[1],1)")); 183 187 close (pipes[1]); 188 /* This is not legal; stfout does not need to be a modifiable 189 lvalue 184 190 if ((stdout = fdopen (1, "w")) == NULL) 185 191 flexfatal (_("fdopen(1) failed")); 186 192 */ 187 193 return true; 188 194 } 189 195 -
flex-2.5.31
diff -Naur flex-2.5.31.orig/flex.skl flex-2.5.31/flex.skl
old new 27 27 %# Macros for runtime processing stage. 28 28 m4_changecom 29 29 m4_changequote 30 31 %# Let user use our quoting strings 32 m4_changequote({, }) 33 m4_define( {m4_userquote_start}, {m4_changequote(<, >)[[m4_changequote([[, ]])}) 34 m4_define( {m4_userquote_end}, {m4_changequote(<, >)]]m4_changequote([[, ]])}) 30 35 m4_changequote([[, ]]) 31 36 32 37 %# … … 345 350 %# yyscan_t yyscanner; 346 351 %# 347 352 %# Generate traditional function defs 348 m4_define( [[YYFARGS0]], [[(M4_YY_DEF_ONLY_ARG) 353 m4_define( [[YYFARGS0]], [[(M4_YY_DEF_ONLY_ARG) [[\]] 349 354 M4_YY_DECL_LAST_ARG]]) 350 m4_define( [[YYFARGS1]], [[($2 M4_YY_DEF_LAST_ARG) 351 $1 $2; 355 m4_define( [[YYFARGS1]], [[($2 M4_YY_DEF_LAST_ARG) [[\]] 356 $1 $2; [[\]] 352 357 M4_YY_DECL_LAST_ARG]]) 353 m4_define( [[YYFARGS2]], [[($2,$4 M4_YY_DEF_LAST_ARG) 354 $1 $2; 355 $3 $4; 358 m4_define( [[YYFARGS2]], [[($2,$4 M4_YY_DEF_LAST_ARG) [[\]] 359 $1 $2; [[\]] 360 $3 $4; [[\]] 356 361 M4_YY_DECL_LAST_ARG]]) 357 m4_define( [[YYFARGS3]], [[($2,$4,$6 M4_YY_DEF_LAST_ARG) 358 $1 $2; 359 $3 $4; 360 $5 $6; 362 m4_define( [[YYFARGS3]], [[($2,$4,$6 M4_YY_DEF_LAST_ARG) [[\]] 363 $1 $2; [[\]] 364 $3 $4; [[\]] 365 $5 $6; [[\]] 361 366 M4_YY_DECL_LAST_ARG]]) 362 367 ]], 363 368 [[ … … 724 729 725 730 m4_ifdef( [[M4_YY_NO_UNISTD_H]],, 726 731 [[ 732 #ifndef YY_NO_UNISTD_H 727 733 /* Special case for "unistd.h", since it is non-ANSI. We include it way 728 734 * down here because we want the user's section 1 to have been scanned first. 729 735 * The user has a chance to override it with an option. … … 734 740 %if-c++-only 735 741 #include <unistd.h> 736 742 %endif 743 #endif 737 744 ]]) 738 745 739 746 #ifndef YY_EXTRA_TYPE … … 1124 1131 m4_dnl The bison pure parser is used. Redefine yylex to 1125 1132 m4_dnl accept the lval parameter. 1126 1133 1127 m4_define( [[M4_YY_LEX_PROTO]], 1134 m4_define( [[M4_YY_LEX_PROTO]], [[\]] 1128 1135 [[M4_YY_PARAMS(YYSTYPE * yylval_param M4_YY_PROTO_LAST_ARG)]]) 1129 m4_define( [[M4_YY_LEX_DECLARATION]], 1136 m4_define( [[M4_YY_LEX_DECLARATION]], [[\]] 1130 1137 [[YYFARGS1(YYSTYPE *,yylval_param)]]) 1131 1138 ]]) 1132 1139 … … 1134 1141 [[ 1135 1142 m4_dnl Locations are used. yylex should also accept the ylloc parameter. 1136 1143 1137 m4_define( [[M4_YY_LEX_PROTO]], 1144 m4_define( [[M4_YY_LEX_PROTO]], [[\]] 1138 1145 [[M4_YY_PARAMS(YYSTYPE * yylval_param, YYLTYPE * yylloc_param M4_YY_PROTO_LAST_ARG)]]) 1139 m4_define( [[M4_YY_LEX_DECLARATION]], 1146 m4_define( [[M4_YY_LEX_DECLARATION]], [[\]] 1140 1147 [[YYFARGS2(YYSTYPE *,yylval_param, YYLTYPE *,yylloc_param)]]) 1141 1148 ]]) 1142 1149 … … 2251 2258 * @note If you want to scan bytes that may contain NUL values, then use 2252 2259 * yy_scan_bytes() instead. 2253 2260 */ 2254 YY_BUFFER_STATE yy_scan_string YYFARGS1( yyconst char *, str)2261 YY_BUFFER_STATE yy_scan_string YYFARGS1( yyconst char *,yy_str) 2255 2262 { 2256 2263 m4_dnl M4_YY_DECL_GUTS_VAR(); 2257 2264 2258 return yy_scan_bytes( str, strlen(str) M4_YY_CALL_LAST_ARG);2265 return yy_scan_bytes( yy_str, strlen(yy_str) M4_YY_CALL_LAST_ARG); 2259 2266 } 2260 2267 %endif 2261 2268 ]]) -
flex-2.5.31
diff -Naur flex-2.5.31.orig/gen.c flex-2.5.31/gen.c
old new 1812 1812 if (yytext_is_array) { 1813 1813 if (!reentrant){ 1814 1814 indent_puts ("static int yy_more_offset = 0;"); 1815 }else{1816 1815 indent_puts ("static int yy_prev_more_offset = 0;"); 1817 1816 } 1818 1817 } -
flex-2.5.31
diff -Naur flex-2.5.31.orig/main.c flex-2.5.31/main.c
old new 199 199 { 200 200 #if ENABLE_NLS 201 201 setlocale (LC_MESSAGES, ""); 202 setlocale (LC_CTYPE, ""); 202 203 textdomain (PACKAGE); 203 204 bindtextdomain (PACKAGE, LOCALEDIR); 204 205 #endif … … 1595 1596 outn ("#else"); 1596 1597 outn (yy_stdinit); 1597 1598 outn ("#endif"); 1598 outn ("#endif");1599 1599 } 1600 1600 1601 1601 else { -
flex-2.5.31
diff -Naur flex-2.5.31.orig/scan.c flex-2.5.31/scan.c
old new 1619 1619 #define LINEDIR 18 1620 1620 #define CODEBLOCK_MATCH_BRACE 19 1621 1621 1622 #ifndef YY_NO_UNISTD_H 1622 1623 /* Special case for "unistd.h", since it is non-ANSI. We include it way 1623 1624 * down here because we want the user's section 1 to have been scanned first. 1624 1625 * The user has a chance to override it with an option. 1625 1626 */ 1626 1627 #include <unistd.h> 1628 #endif 1627 1629 1628 1630 #ifndef YY_EXTRA_TYPE 1629 1631 #define YY_EXTRA_TYPE void * -
flex-2.5.31
diff -Naur flex-2.5.31.orig/scan.l flex-2.5.31/scan.l
old new 194 194 <COMMENT>{ 195 195 "*/" ACTION_ECHO; yy_pop_state(); 196 196 "*" ACTION_ECHO; 197 [^*\n]+ ACTION_ECHO; 198 [^*\n]*{NL} ++linenum; ACTION_ECHO; 197 [\[\]] ACTION_ECHO; 198 [^*\[\]\n]+ ACTION_ECHO; 199 [^*\[\]\n]*{NL} ++linenum; ACTION_ECHO; 200 \[\[ add_action("[" "[]" "]m4_" "userquote_start()"); 201 \]\] add_action("[" "[]" "]m4_" "userquote_end()"); 202 /* Macros need to be clearly separated from surrounding 203 * text and this file needs to go through flex untouched. 204 */ 199 205 } 200 206 201 207 <LINEDIR>{ -
flex-2.5.31
diff -Naur flex-2.5.31.orig/skel.c flex-2.5.31/skel.c
old new 404 404 "%# yyscan_t yyscanner;", 405 405 "%#", 406 406 "%# Generate traditional function defs", 407 " m4_define( [[YYFARGS0]], [[(M4_YY_DEF_ONLY_ARG) ",407 " m4_define( [[YYFARGS0]], [[(M4_YY_DEF_ONLY_ARG) [[\\]]", 408 408 " M4_YY_DECL_LAST_ARG]])", 409 " m4_define( [[YYFARGS1]], [[($2 M4_YY_DEF_LAST_ARG) ",409 " m4_define( [[YYFARGS1]], [[($2 M4_YY_DEF_LAST_ARG) [[\\]]", 410 410 " $1 $2;", 411 411 " M4_YY_DECL_LAST_ARG]])", 412 " m4_define( [[YYFARGS2]], [[($2,$4 M4_YY_DEF_LAST_ARG) ",412 " m4_define( [[YYFARGS2]], [[($2,$4 M4_YY_DEF_LAST_ARG) [[\\]]", 413 413 " $1 $2;", 414 414 " $3 $4;", 415 415 " M4_YY_DECL_LAST_ARG]])", 416 " m4_define( [[YYFARGS3]], [[($2,$4,$6 M4_YY_DEF_LAST_ARG) ",416 " m4_define( [[YYFARGS3]], [[($2,$4,$6 M4_YY_DEF_LAST_ARG) [[\\]]", 417 417 " $1 $2;", 418 418 " $3 $4;", 419 419 " $5 $6;", … … 783 783 "", 784 784 "m4_ifdef( [[M4_YY_NO_UNISTD_H]],,", 785 785 "[[", 786 "#ifndef YY_NO_UNISTD_H", 786 787 "/* Special case for \"unistd.h\", since it is non-ANSI. We include it way", 787 788 " * down here because we want the user's section 1 to have been scanned first.", 788 789 " * The user has a chance to override it with an option.", … … 793 794 "%if-c++-only", 794 795 "#include <unistd.h>", 795 796 "%endif", 797 "#endif", 796 798 "]])", 797 799 "", 798 800 "#ifndef YY_EXTRA_TYPE", … … 2454 2456 " * @note If you want to scan bytes that may contain NUL values, then use", 2455 2457 " * yy_scan_bytes() instead.", 2456 2458 " */", 2457 "YY_BUFFER_STATE yy_scan_string YYFARGS1( yyconst char *, str)",2459 "YY_BUFFER_STATE yy_scan_string YYFARGS1( yyconst char *,yy_str)", 2458 2460 "{", 2459 2461 " m4_dnl M4_YY_DECL_GUTS_VAR();", 2460 2462 "", 2461 " return yy_scan_bytes( str, strlen(str) M4_YY_CALL_LAST_ARG);",2463 " return yy_scan_bytes( yy_str, strlen(yy_str) M4_YY_CALL_LAST_ARG);", 2462 2464 "}", 2463 2465 "%endif", 2464 2466 "]])",
Note:
See TracBrowser
for help on using the repository browser.