source: scripts/patches/flex-2.5.31-debian_fixes-2.patch@ cb92ef5

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since cb92ef5 was 7f65c0e, checked in by Jim Gifford <clfs@…>, 19 years ago

r625@server (orig r623): jim | 2005-10-31 12:43:24 -0800
Final Move

  • Property mode set to 100644
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  
    157157                if (chain->filter_func) {
    158158                        int     r;
    159159
    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.
    161164                        if ((stdin = fdopen (0, "r")) == NULL)
    162165                                flexfatal (_("fdopen(0) failed"));
    163166                        if ((stdout = fdopen (1, "w")) == NULL)
    164167                                flexfatal (_("fdopen(1) failed"));
     168      */
    165169
    166170                        if ((r = chain->filter_func (chain)) == -1)
    167171                                flexfatal (_("filter_func failed"));
     
    181185        if (dup2 (pipes[1], 1) == -1)
    182186                flexfatal (_("dup2(pipes[1],1)"));
    183187        close (pipes[1]);
     188        /* This is not legal; stfout does not need to be a modifiable
     189        lvalue
    184190        if ((stdout = fdopen (1, "w")) == NULL)
    185191                flexfatal (_("fdopen(1) failed"));
    186 
     192        */
    187193        return true;
    188194}
    189195
  • flex-2.5.31

    diff -Naur flex-2.5.31.orig/flex.skl flex-2.5.31/flex.skl
    old new  
    2727%# Macros for runtime processing stage.
    2828m4_changecom
    2929m4_changequote
     30
     31%# Let user use our quoting strings
     32m4_changequote({, })
     33m4_define( {m4_userquote_start}, {m4_changequote(<, >)[[m4_changequote([[, ]])})
     34m4_define( {m4_userquote_end}, {m4_changequote(<, >)]]m4_changequote([[, ]])})
    3035m4_changequote([[, ]])
    3136
    3237%#
     
    345350%#        yyscan_t yyscanner;
    346351%#
    347352%# Generate traditional function defs
    348     m4_define( [[YYFARGS0]], [[(M4_YY_DEF_ONLY_ARG)
     353    m4_define( [[YYFARGS0]], [[(M4_YY_DEF_ONLY_ARG) [[\]]
    349354        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; [[\]]
    352357        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; [[\]]
    356361        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; [[\]]
    361366        M4_YY_DECL_LAST_ARG]])
    362367]],
    363368[[
     
    724729
    725730m4_ifdef( [[M4_YY_NO_UNISTD_H]],,
    726731[[
     732#ifndef YY_NO_UNISTD_H
    727733/* Special case for "unistd.h", since it is non-ANSI. We include it way
    728734 * down here because we want the user's section 1 to have been scanned first.
    729735 * The user has a chance to override it with an option.
     
    734740%if-c++-only
    735741#include <unistd.h>
    736742%endif
     743#endif
    737744]])
    738745
    739746#ifndef YY_EXTRA_TYPE
     
    11241131    m4_dnl  The bison pure parser is used. Redefine yylex to
    11251132    m4_dnl  accept the lval parameter.
    11261133
    1127     m4_define( [[M4_YY_LEX_PROTO]],
     1134    m4_define( [[M4_YY_LEX_PROTO]], [[\]]
    11281135               [[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]], [[\]]
    11301137               [[YYFARGS1(YYSTYPE *,yylval_param)]])
    11311138]])
    11321139
     
    11341141[[
    11351142    m4_dnl  Locations are used. yylex should also accept the ylloc parameter.
    11361143
    1137     m4_define( [[M4_YY_LEX_PROTO]],
     1144    m4_define( [[M4_YY_LEX_PROTO]], [[\]]
    11381145               [[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]], [[\]]
    11401147               [[YYFARGS2(YYSTYPE *,yylval_param, YYLTYPE *,yylloc_param)]])
    11411148]])
    11421149
     
    22512258 * @note If you want to scan bytes that may contain NUL values, then use
    22522259 *       yy_scan_bytes() instead.
    22532260 */
    2254 YY_BUFFER_STATE yy_scan_string YYFARGS1( yyconst char *,str)
     2261YY_BUFFER_STATE yy_scan_string YYFARGS1( yyconst char *,yy_str)
    22552262{
    22562263    m4_dnl M4_YY_DECL_GUTS_VAR();
    22572264
    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);
    22592266}
    22602267%endif
    22612268]])
  • flex-2.5.31

    diff -Naur flex-2.5.31.orig/gen.c flex-2.5.31/gen.c
    old new  
    18121812                        if (yytext_is_array) {
    18131813                                if (!reentrant){
    18141814                                indent_puts ("static int yy_more_offset = 0;");
    1815                 }else{
    18161815                    indent_puts ("static int yy_prev_more_offset = 0;");
    18171816                }
    18181817                        }
  • flex-2.5.31

    diff -Naur flex-2.5.31.orig/main.c flex-2.5.31/main.c
    old new  
    199199{
    200200#if ENABLE_NLS
    201201        setlocale (LC_MESSAGES, "");
     202        setlocale (LC_CTYPE, "");
    202203        textdomain (PACKAGE);
    203204        bindtextdomain (PACKAGE, LOCALEDIR);
    204205#endif
     
    15951596                        outn ("#else");
    15961597                        outn (yy_stdinit);
    15971598                        outn ("#endif");
    1598                         outn ("#endif");
    15991599                }
    16001600
    16011601                else {
  • flex-2.5.31

    diff -Naur flex-2.5.31.orig/scan.c flex-2.5.31/scan.c
    old new  
    16191619#define LINEDIR 18
    16201620#define CODEBLOCK_MATCH_BRACE 19
    16211621
     1622#ifndef YY_NO_UNISTD_H
    16221623/* Special case for "unistd.h", since it is non-ANSI. We include it way
    16231624 * down here because we want the user's section 1 to have been scanned first.
    16241625 * The user has a chance to override it with an option.
    16251626 */
    16261627#include <unistd.h>
     1628#endif
    16271629
    16281630#ifndef YY_EXTRA_TYPE
    16291631#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  
    194194<COMMENT>{
    195195        "*/"            ACTION_ECHO; yy_pop_state();
    196196        "*"             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                         */
    199205}
    200206
    201207<LINEDIR>{
  • flex-2.5.31

    diff -Naur flex-2.5.31.orig/skel.c flex-2.5.31/skel.c
    old new  
    404404  "%#        yyscan_t yyscanner;",
    405405  "%#",
    406406  "%# Generate traditional function defs",
    407   "    m4_define( [[YYFARGS0]], [[(M4_YY_DEF_ONLY_ARG)",
     407  "    m4_define( [[YYFARGS0]], [[(M4_YY_DEF_ONLY_ARG) [[\\]]",
    408408  "        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) [[\\]]",
    410410  "        $1 $2;",
    411411  "        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) [[\\]]",
    413413  "        $1 $2;",
    414414  "        $3 $4;",
    415415  "        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) [[\\]]",
    417417  "        $1 $2;",
    418418  "        $3 $4;",
    419419  "        $5 $6;",
     
    783783  "",
    784784  "m4_ifdef( [[M4_YY_NO_UNISTD_H]],,",
    785785  "[[",
     786  "#ifndef YY_NO_UNISTD_H",
    786787  "/* Special case for \"unistd.h\", since it is non-ANSI. We include it way",
    787788  " * down here because we want the user's section 1 to have been scanned first.",
    788789  " * The user has a chance to override it with an option.",
     
    793794  "%if-c++-only",
    794795  "#include <unistd.h>",
    795796  "%endif",
     797  "#endif",
    796798  "]])",
    797799  "",
    798800  "#ifndef YY_EXTRA_TYPE",
     
    24542456  " * @note If you want to scan bytes that may contain NUL values, then use",
    24552457  " *       yy_scan_bytes() instead.",
    24562458  " */",
    2457   "YY_BUFFER_STATE yy_scan_string YYFARGS1( yyconst char *,str)",
     2459  "YY_BUFFER_STATE yy_scan_string YYFARGS1( yyconst char *,yy_str)",
    24582460  "{",
    24592461  "    m4_dnl M4_YY_DECL_GUTS_VAR();",
    24602462  "",
    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);",
    24622464  "}",
    24632465  "%endif",
    24642466  "]])",
Note: See TracBrowser for help on using the repository browser.