1 --- flex-2.5.31.orig/filter.c 2003-03-25 11:39:08.000000000 -0500
2 +++ flex-2.5.31/filter.c 2004-03-01 23:14:28.868777672 -0500
4 if (chain->filter_func) {
7 - /* setup streams again */
8 + /* setup streams again -- Removed. POSIX states that children inherit
9 + open streams in the parent. Also, ANSI C99 states that the stdin
10 + and stdout macors need not be modified lvalues; so this code is
11 + broken in the first place.
12 if ((stdin = fdopen (0, "r")) == NULL)
13 flexfatal (_("fdopen(0) failed"));
14 if ((stdout = fdopen (1, "w")) == NULL)
15 flexfatal (_("fdopen(1) failed"));
18 if ((r = chain->filter_func (chain)) == -1)
19 flexfatal (_("filter_func failed"));
21 if (dup2 (pipes[1], 1) == -1)
22 flexfatal (_("dup2(pipes[1],1)"));
24 + /* This is not legal; stfout does not need to be a modifiable
26 if ((stdout = fdopen (1, "w")) == NULL)
27 flexfatal (_("fdopen(1) failed"));
33 --- flex-2.5.31.orig/flex.skl 2003-03-31 20:51:38.000000000 -0500
34 +++ flex-2.5.31/flex.skl 2004-03-01 23:14:28.870777368 -0500
36 %# Macros for runtime processing stage.
40 +%# Let user use our quoting strings
42 +m4_define( {m4_userquote_start}, {m4_changequote(<, >)[[m4_changequote([[, ]])})
43 +m4_define( {m4_userquote_end}, {m4_changequote(<, >)]]m4_changequote([[, ]])})
44 m4_changequote([[, ]])
48 %# yyscan_t yyscanner;
50 %# Generate traditional function defs
51 - m4_define( [[YYFARGS0]], [[(M4_YY_DEF_ONLY_ARG)
52 + m4_define( [[YYFARGS0]], [[(M4_YY_DEF_ONLY_ARG) [[\]]
53 M4_YY_DECL_LAST_ARG]])
54 - m4_define( [[YYFARGS1]], [[($2 M4_YY_DEF_LAST_ARG)
56 + m4_define( [[YYFARGS1]], [[($2 M4_YY_DEF_LAST_ARG) [[\]]
58 M4_YY_DECL_LAST_ARG]])
59 - m4_define( [[YYFARGS2]], [[($2,$4 M4_YY_DEF_LAST_ARG)
62 + m4_define( [[YYFARGS2]], [[($2,$4 M4_YY_DEF_LAST_ARG) [[\]]
65 M4_YY_DECL_LAST_ARG]])
66 - m4_define( [[YYFARGS3]], [[($2,$4,$6 M4_YY_DEF_LAST_ARG)
70 + m4_define( [[YYFARGS3]], [[($2,$4,$6 M4_YY_DEF_LAST_ARG) [[\]]
74 M4_YY_DECL_LAST_ARG]])
79 m4_ifdef( [[M4_YY_NO_UNISTD_H]],,
81 +#ifndef YY_NO_UNISTD_H
82 /* Special case for "unistd.h", since it is non-ANSI. We include it way
83 * down here because we want the user's section 1 to have been scanned first.
84 * The user has a chance to override it with an option.
94 m4_dnl The bison pure parser is used. Redefine yylex to
95 m4_dnl accept the lval parameter.
97 - m4_define( [[M4_YY_LEX_PROTO]],
98 + m4_define( [[M4_YY_LEX_PROTO]], [[\]]
99 [[M4_YY_PARAMS(YYSTYPE * yylval_param M4_YY_PROTO_LAST_ARG)]])
100 - m4_define( [[M4_YY_LEX_DECLARATION]],
101 + m4_define( [[M4_YY_LEX_DECLARATION]], [[\]]
102 [[YYFARGS1(YYSTYPE *,yylval_param)]])
105 @@ -1134,9 +1141,9 @@
107 m4_dnl Locations are used. yylex should also accept the ylloc parameter.
109 - m4_define( [[M4_YY_LEX_PROTO]],
110 + m4_define( [[M4_YY_LEX_PROTO]], [[\]]
111 [[M4_YY_PARAMS(YYSTYPE * yylval_param, YYLTYPE * yylloc_param M4_YY_PROTO_LAST_ARG)]])
112 - m4_define( [[M4_YY_LEX_DECLARATION]],
113 + m4_define( [[M4_YY_LEX_DECLARATION]], [[\]]
114 [[YYFARGS2(YYSTYPE *,yylval_param, YYLTYPE *,yylloc_param)]])
117 @@ -2251,11 +2258,11 @@
118 * @note If you want to scan bytes that may contain NUL values, then use
119 * yy_scan_bytes() instead.
121 -YY_BUFFER_STATE yy_scan_string YYFARGS1( yyconst char *,str)
122 +YY_BUFFER_STATE yy_scan_string YYFARGS1( yyconst char *,yy_str)
124 m4_dnl M4_YY_DECL_GUTS_VAR();
126 - return yy_scan_bytes( str, strlen(str) M4_YY_CALL_LAST_ARG);
127 + return yy_scan_bytes( yy_str, strlen(yy_str) M4_YY_CALL_LAST_ARG);
131 --- flex-2.5.31.orig/gen.c 2003-03-30 14:58:44.000000000 -0500
132 +++ flex-2.5.31/gen.c 2004-03-01 23:14:28.862778584 -0500
133 @@ -1812,7 +1812,6 @@
134 if (yytext_is_array) {
136 indent_puts ("static int yy_more_offset = 0;");
138 indent_puts ("static int yy_prev_more_offset = 0;");
141 --- flex-2.5.31.orig/main.c 2003-03-31 20:51:38.000000000 -0500
142 +++ flex-2.5.31/main.c 2004-03-01 23:14:28.863778432 -0500
146 setlocale (LC_MESSAGES, "");
147 + setlocale (LC_CTYPE, "");
148 textdomain (PACKAGE);
149 bindtextdomain (PACKAGE, LOCALEDIR);
151 @@ -1595,7 +1596,6 @@
159 --- flex-2.5.31.orig/scan.c 2003-04-01 11:33:17.000000000 -0500
160 +++ flex-2.5.31/scan.c 2004-03-01 23:14:28.860778888 -0500
161 @@ -1619,11 +1619,13 @@
163 #define CODEBLOCK_MATCH_BRACE 19
165 +#ifndef YY_NO_UNISTD_H
166 /* Special case for "unistd.h", since it is non-ANSI. We include it way
167 * down here because we want the user's section 1 to have been scanned first.
168 * The user has a chance to override it with an option.
173 #ifndef YY_EXTRA_TYPE
174 #define YY_EXTRA_TYPE void *
175 --- flex-2.5.31.orig/scan.l 2003-03-31 20:51:38.000000000 -0500
176 +++ flex-2.5.31/scan.l 2004-03-01 23:14:28.864778280 -0500
179 "*/" ACTION_ECHO; yy_pop_state();
181 - [^*\n]+ ACTION_ECHO;
182 - [^*\n]*{NL} ++linenum; ACTION_ECHO;
183 + [\[\]] ACTION_ECHO;
184 + [^*\[\]\n]+ ACTION_ECHO;
185 + [^*\[\]\n]*{NL} ++linenum; ACTION_ECHO;
186 + \[\[ add_action("[" "[]" "]m4_" "userquote_start()");
187 + \]\] add_action("[" "[]" "]m4_" "userquote_end()");
188 + /* Macros need to be clearly separated from surrounding
189 + * text and this file needs to go through flex untouched.
194 --- flex-2.5.31.orig/skel.c 2003-04-01 11:33:08.000000000 -0500
195 +++ flex-2.5.31/skel.c 2004-03-01 23:14:28.867777824 -0500
196 @@ -404,16 +404,16 @@
197 "%# yyscan_t yyscanner;",
199 "%# Generate traditional function defs",
200 - " m4_define( [[YYFARGS0]], [[(M4_YY_DEF_ONLY_ARG)",
201 + " m4_define( [[YYFARGS0]], [[(M4_YY_DEF_ONLY_ARG) [[\\]]",
202 " M4_YY_DECL_LAST_ARG]])",
203 - " m4_define( [[YYFARGS1]], [[($2 M4_YY_DEF_LAST_ARG)",
204 + " m4_define( [[YYFARGS1]], [[($2 M4_YY_DEF_LAST_ARG) [[\\]]",
206 " M4_YY_DECL_LAST_ARG]])",
207 - " m4_define( [[YYFARGS2]], [[($2,$4 M4_YY_DEF_LAST_ARG)",
208 + " m4_define( [[YYFARGS2]], [[($2,$4 M4_YY_DEF_LAST_ARG) [[\\]]",
211 " M4_YY_DECL_LAST_ARG]])",
212 - " m4_define( [[YYFARGS3]], [[($2,$4,$6 M4_YY_DEF_LAST_ARG)",
213 + " m4_define( [[YYFARGS3]], [[($2,$4,$6 M4_YY_DEF_LAST_ARG) [[\\]]",
219 "m4_ifdef( [[M4_YY_NO_UNISTD_H]],,",
221 + "#ifndef YY_NO_UNISTD_H",
222 "/* Special case for \"unistd.h\", since it is non-ANSI. We include it way",
223 " * down here because we want the user's section 1 to have been scanned first.",
224 " * The user has a chance to override it with an option.",
227 "#include <unistd.h>",
232 "#ifndef YY_EXTRA_TYPE",
233 @@ -2454,11 +2456,11 @@
234 " * @note If you want to scan bytes that may contain NUL values, then use",
235 " * yy_scan_bytes() instead.",
237 - "YY_BUFFER_STATE yy_scan_string YYFARGS1( yyconst char *,str)",
238 + "YY_BUFFER_STATE yy_scan_string YYFARGS1( yyconst char *,yy_str)",
240 " m4_dnl M4_YY_DECL_GUTS_VAR();",
242 - " return yy_scan_bytes( str, strlen(str) M4_YY_CALL_LAST_ARG);",
243 + " return yy_scan_bytes( yy_str, strlen(yy_str) M4_YY_CALL_LAST_ARG);",