[asterisk-commits] murf: branch group/mime r61616 - /team/group/mime/main/minimime/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Apr 11 17:06:53 MST 2007


Author: murf
Date: Wed Apr 11 19:06:53 2007
New Revision: 61616

URL: http://svn.digium.com/view/asterisk?view=rev&rev=61616
Log:
OK, the lexer no longer uses REJECT, and therefore doesn't want to abort because of fixed buffers. Solved via divide-and-conquer approach. Also, derailed the FATAL_ERROR stuff from calling exit; you need to patch the yy.c file; I've added the patch file and added a comment to the makefile.

Added:
    team/group/mime/main/minimime/lexfix   (with props)
Modified:
    team/group/mime/main/minimime/Makefile
    team/group/mime/main/minimime/mimeparser.l
    team/group/mime/main/minimime/mimeparser.yy.c

Modified: team/group/mime/main/minimime/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/mime/main/minimime/Makefile?view=diff&rev=61616&r1=61615&r2=61616
==============================================================================
--- team/group/mime/main/minimime/Makefile (original)
+++ team/group/mime/main/minimime/Makefile Wed Apr 11 19:06:53 2007
@@ -59,6 +59,7 @@
 
 #mimeparser.yy.c: mimeparser.l
 #	flex -Pmimeparser_yy -omimeparser.yy.c mimeparser.l
+#	patch -p0 < lexfix
 
 #mimeparser.tab.c: mimeparser.y
 #	bison -d -pmimeparser_yy -omimeparser.tab.c mimeparser.y

Added: team/group/mime/main/minimime/lexfix
URL: http://svn.digium.com/view/asterisk/team/group/mime/main/minimime/lexfix?view=auto&rev=61616
==============================================================================
--- team/group/mime/main/minimime/lexfix (added)
+++ team/group/mime/main/minimime/lexfix Wed Apr 11 19:06:53 2007
@@ -1,0 +1,56 @@
+--- mimeparser.yy.c	2007-04-11 17:43:49.000000000 -0600
++++ mimeparser.yy.c.fixed	2007-04-11 17:43:14.000000000 -0600
+@@ -1769,7 +1769,7 @@
+ 			yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
+ 
+ 		if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
+-			YY_FATAL_ERROR( "flex scanner push-back overflow" );
++			YY_FATAL_ERROR2( "flex scanner push-back overflow" );
+ 		}
+ 
+ 	*--yy_cp = (char) c;
+@@ -1942,7 +1942,7 @@
+     
+ 	b = (YY_BUFFER_STATE) mimeparser_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
+ 	if ( ! b )
+-		YY_FATAL_ERROR( "out of dynamic memory in mimeparser_yy_create_buffer()" );
++		YY_FATAL_ERROR3( "out of dynamic memory in mimeparser_yy_create_buffer()" );
+ 
+ 	b->yy_buf_size = size;
+ 
+@@ -1951,7 +1951,7 @@
+ 	 */
+ 	b->yy_ch_buf = (char *) mimeparser_yyalloc(b->yy_buf_size + 2 ,yyscanner );
+ 	if ( ! b->yy_ch_buf )
+-		YY_FATAL_ERROR( "out of dynamic memory in mimeparser_yy_create_buffer()" );
++		YY_FATAL_ERROR3( "out of dynamic memory in mimeparser_yy_create_buffer()" );
+ 
+ 	b->yy_is_our_buffer = 1;
+ 
+@@ -2156,7 +2156,7 @@
+ 
+ 	b = (YY_BUFFER_STATE) mimeparser_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
+ 	if ( ! b )
+-		YY_FATAL_ERROR( "out of dynamic memory in mimeparser_yy_scan_buffer()" );
++		YY_FATAL_ERROR3( "out of dynamic memory in mimeparser_yy_scan_buffer()" );
+ 
+ 	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
+ 	b->yy_buf_pos = b->yy_ch_buf = base;
+@@ -2205,7 +2205,7 @@
+ 	n = len + 2;
+ 	buf = (char *) mimeparser_yyalloc(n ,yyscanner );
+ 	if ( ! buf )
+-		YY_FATAL_ERROR( "out of dynamic memory in mimeparser_yy_scan_bytes()" );
++		YY_FATAL_ERROR3( "out of dynamic memory in mimeparser_yy_scan_bytes()" );
+ 
+ 	for ( i = 0; i < len; ++i )
+ 		buf[i] = bytes[i];
+@@ -2214,7 +2214,7 @@
+ 
+ 	b = mimeparser_yy_scan_buffer(buf,n ,yyscanner);
+ 	if ( ! b )
+-		YY_FATAL_ERROR( "bad buffer in mimeparser_yy_scan_bytes()" );
++		YY_FATAL_ERROR3( "bad buffer in mimeparser_yy_scan_bytes()" );
+ 
+ 	/* It's okay to grow etc. this buffer, and we should throw it
+ 	 * away when we're done.

Propchange: team/group/mime/main/minimime/lexfix
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/group/mime/main/minimime/lexfix
------------------------------------------------------------------------------
    svn:keywords = Author Id Date Revision

Propchange: team/group/mime/main/minimime/lexfix
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: team/group/mime/main/minimime/mimeparser.l
URL: http://svn.digium.com/view/asterisk/team/group/mime/main/minimime/mimeparser.l?view=diff&rev=61616&r1=61615&r2=61616
==============================================================================
--- team/group/mime/main/minimime/mimeparser.l (original)
+++ team/group/mime/main/minimime/mimeparser.l Wed Apr 11 19:06:53 2007
@@ -44,6 +44,8 @@
 #include "mimeparser.h"
 #include "mimeparser.tab.h"
 
+void yy_fatal_error2( char *msg , void *yyscanner);
+
 #define NAMEOF(v) #v
 /* BC() is a debug wrapper for lex' BEGIN() macro */
 #define BC(x) do { \
@@ -54,9 +56,9 @@
 
 #define ZERO(x) memset(x, '\0', sizeof(x))
 
-#define PREALLOC_BUFFER	100000
-#undef YY_BUF_SIZE
-#define YY_BUF_SIZE 562072
+#define YY_FATAL_ERROR(msg) { yy_fatal_error2( msg , yyscanner); return EOF; }
+#define YY_FATAL_ERROR2(msg) { yy_fatal_error2( msg , yyscanner); return; }
+#define YY_FATAL_ERROR3(msg) { yy_fatal_error2( msg , yyscanner); return NULL; }
 
 enum header_states
 {
@@ -79,6 +81,7 @@
 %s headers
 %s header
 %s headervalue
+%s headervalue2
 %s tspecialvalue
 %s comment
 %s body
@@ -152,7 +155,11 @@
 
 <header>\: {
 	struct lexer_state *lstate = yyget_extra(yyscanner);
-	BC(headervalue); 
+	if (lstate->header_state == STATE_MAIL || lstate->header_state == STATE_CENC) {
+		BC(headervalue2);
+	} else {
+		BC(headervalue);
+	}
 	lstate->current_pos += yyleng;
 	return COLON;
 }	
@@ -170,11 +177,8 @@
 	lstate->current_pos += yyleng;
 }
 
-<headervalue>.+|(.+(\n|\r\n)[\ \t]+.+)+ {
-	struct lexer_state *lstate = yyget_extra(yyscanner);
-	if (lstate->header_state != STATE_MAIL && lstate->header_state != STATE_CENC) {
-		REJECT;
-	}
+<headervalue2>.+|(.+(\n|\r\n)[\ \t]+.+)+ {
+	struct lexer_state *lstate = yyget_extra(yyscanner);
 	lstate->current_pos += yyleng;
 	while (*yytext && isspace(*yytext)) yytext++;
 	/* Do we actually have a header value? */
@@ -183,8 +187,17 @@
 	} else {
 		yylval_param->string=strdup(yytext); 
 		lstate->lineno += count_lines(yytext);
-	}	
+	}
 	return WORD;
+}
+
+<headervalue2>(\r\n|\n) {
+	struct lexer_state *lstate = yyget_extra(yyscanner);
+	/* marks the end of one header line */
+	lstate->lineno++;
+	BC(headers);
+	lstate->current_pos += yyleng;
+	return EOL;
 }
 
 <headervalue,tspecialvalue>(\r\n|\n) {
@@ -256,7 +269,8 @@
 	if (lstate->endboundary_string != NULL) {
 		if (strcmp(lstate->endboundary_string, yytext)) {
 			/* dprintf2("YYTEXT != end_boundary: '%s'\n", yytext); */
-			REJECT;
+			lstate->current_pos += yyleng;
+			/* REJECT; no-- just let it be absorbed into the body */
 		} else {
 			lstate->current_pos += yyleng;
 			/* dprintf2("YYTEXT == lstate->end_boundary: '%s'\n", yytext); */
@@ -271,12 +285,10 @@
 				yyless(0);
 				BC(endboundary);
 				return BODY;
-			}	
-		}
+			}
+        }	
 	} else {
 	}	
-
-	REJECT;
 }
 
 <body,preamble>^\-\-{TSPECIAL}+ {
@@ -288,7 +300,8 @@
 	if (lstate->boundary_string != NULL) {
 		if (strcmp(lstate->boundary_string, yytext)) {
 			/* dprintf2("YYTEXT != boundary: '%s'\n", yytext);*/
-			REJECT;
+			lstate->current_pos += yyleng;
+			/* REJECT; no-- just let it be absorbed into the body */
 		} else {
 			/* dprintf2("YYTEXT == boundary: '%s'\n", yytext);*/
 			if (lstate->body_start) {
@@ -314,11 +327,9 @@
 				lstate->current_pos += yyleng;
 				return(BOUNDARY);
 			}
-		}
+	   }
 	} else {
 	}	
-
-	REJECT;
 }
 
 <body>(\r\n|\n) {
@@ -482,3 +493,18 @@
 
 	return line;
 }
+
+
+void yy_fatal_error2( char *msg , void *yyscanner)
+{
+	if (0)
+		yy_fatal_error(msg,yyscanner); /* just to avoid a 'defined, but not used' message */
+	printf("The parse is pretty much OVER!\n");
+}
+void *yy_fatal_error3( char *msg , void *yyscanner)
+{
+	if (0)
+		yy_fatal_error(msg,yyscanner); /* just to avoid a 'defined, but not used' message */
+	printf("The parse is pretty much OVER!\n");
+	return NULL;
+}

Modified: team/group/mime/main/minimime/mimeparser.yy.c
URL: http://svn.digium.com/view/asterisk/team/group/mime/main/minimime/mimeparser.yy.c?view=diff&rev=61616&r1=61615&r2=61616
==============================================================================
--- team/group/mime/main/minimime/mimeparser.yy.c (original)
+++ team/group/mime/main/minimime/mimeparser.yy.c Wed Apr 11 19:06:53 2007
@@ -353,8 +353,8 @@
 	*yy_cp = '\0'; \
 	yyg->yy_c_buf_p = yy_cp;
 
-#define YY_NUM_RULES 30
-#define YY_END_OF_BUFFER 31
+#define YY_NUM_RULES 31
+#define YY_END_OF_BUFFER 32
 /* This struct is not used in this scanner,
    but its presence is necessary. */
 struct yy_trans_info
@@ -362,44 +362,20 @@
 	flex_int32_t yy_verify;
 	flex_int32_t yy_nxt;
 	};
-static yyconst flex_int16_t yy_acclist[179] =
+static yyconst flex_int16_t yy_accept[110] =
     {   0,
-       31,    2,   29,   30,   28,   30,    2,   29,   30,    1,
-        2,   29,   30,    3,   28,   30,    2,   29,   30,   29,
-       30,    5,   28,   30,   29,   30,    4,   29,   30,    7,
-       29,   30,    7,   13,   29,   30,    8,   28,   30,    7,
-       29,   30,    7,   11,   29,   30,    7,   12,   29,   30,
-        7,   12,   29,   30,    7,    9,   29,   30,    7,   10,
-       29,   30,    8,   28,   30,   29,   30,   14,   29,   30,
-       15,   29,   30,   29,   30,   20,   29,   30,   18,   28,
-       30,   19,   29,   30,   20,   29,   30,   27,   29,   30,
-       21,   28,   30,   27,   29,   30,   26,   29,   30,   26,
-
-       29,   30,   26,   29,   30,   22,   29,   30,   24,   28,
-       30,   29,   30,   23,   29,   30,   25,   28,   30,   29,
-       30,   28,    1,    1,    3,   28,    5,   28,    7,    7,
-        7,   13,    6,    8,   28,    7,   12,    7,   12,    7,
-        8,   28,   14,   20,   18,   28,   20,   21,   28,   22,
-       24,   28,   23,   25,   28,    6,    9,   17,   20,   17,
-        7,    7,    6,    7,    7,    9,   17,   20,    7,    7,
-        6,    7,    7,    9,   16,   17,   20,    7
-    } ;
-
-static yyconst flex_int16_t yy_accept[112] =
-    {   0,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    2,    5,    7,   10,   14,
-       17,   20,   22,   25,   27,   30,   33,   37,   40,   43,
-       47,   51,   55,   59,   63,   66,   68,   71,   74,   76,
-       79,   82,   85,   88,   91,   94,   97,  100,  103,  106,
-      109,  112,  114,  117,  120,  122,  123,  124,  125,  127,
-      129,  130,  130,  131,  133,  134,  136,  138,  140,  140,
-      141,  143,  144,  145,  147,  148,  150,  150,  151,  153,
-      154,  156,  156,  156,  157,  158,  158,  160,  161,  162,
-
-      163,  165,  167,  169,  170,  171,  173,  175,  178,  179,
-      179
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,   32,    2,   29,    2,
+        1,    3,    2,   30,    5,   30,    4,   14,    9,   30,
+       12,   13,   13,   10,   11,    7,    8,    7,    9,   30,
+       15,   16,   30,   21,   19,   20,   21,   28,   22,   28,
+       27,   27,   27,   23,   25,   30,   24,   26,   30,   29,
+        1,    1,    3,    5,   14,    6,    9,   13,   13,    0,
+        0,    7,    0,    7,    8,    9,   15,   21,   19,   21,
+       22,    0,   23,   25,   24,   26,   10,    0,    0,   18,
+
+       18,    7,    7,   18,    7,    7,   17,    7,    0
     } ;
 
 static yyconst flex_int32_t yy_ec[256] =
@@ -436,126 +412,136 @@
 
 static yyconst flex_int32_t yy_meta[18] =
     {   0,
-        1,    1,    2,    3,    4,    1,    4,    5,    4,    4,
-        5,    4,    4,    4,    5,    1,    1
+        1,    2,    3,    4,    5,    1,    6,    7,    6,    8,
+        7,    8,    8,    8,    7,    9,    2
     } ;
 
-static yyconst flex_int16_t yy_base[128] =
+static yyconst flex_int16_t yy_base[131] =
     {   0,
-        0,    2,    4,   15,   28,   38,   50,    0,   67,    0,
-        6,    8,   10,   82,   12,   17,   19,   88,   21,   23,
-       25,   30,   32,   34,  228,  253,  253,  224,  208,  253,
-      219,  253,  253,  165,  253,   40,   95,   43,   43,   84,
-      110,  119,   90,   98,  253,  155,    0,  253,  153,    0,
-      253,  148,  131,  253,  253,  132,  253,  128,  116,    0,
-      253,  119,    0,  253,  108,  253,    0,   80,  253,  253,
-      100,  103,  103,    0,  118,  127,    0,    0,  131,  106,
-      253,    0,    0,  253,  136,  253,    0,    0,  253,    0,
-      253,  138,  139,  143,  144,  145,  153,    0,    0,  155,
-
-      160,  161,   81,  112,  169,  162,  173,   41,  173,  253,
-      178,  183,  188,  193,  198,  203,  208,   34,  213,  215,
-      220,  225,  230,  235,  237,  242,  247
+        0,    2,    4,   15,   28,   38,   50,    0,    6,    8,
+       67,    0,   10,   12,   17,   82,   19,   21,   23,   88,
+       25,   30,   32,   34,   40,   42,  235,  312,  312,  228,
+      215,  312,  147,  312,  312,  146,  312,    0,   92,  145,
+      312,    0,   32,   84,  312,   95,  312,   97,  312,  144,
+        0,  312,  143,    0,  312,  142,  136,  312,  312,  139,
+      312,  137,  131,    0,  312,  135,    0,  312,  126,  312,
+        0,  106,  312,  312,    0,  100,  101,    0,   88,  105,
+       90,  105,  109,  109,  113,  312,    0,    0,  312,  118,
+      312,    0,    0,  312,    0,  312,  120,  121,  125,  135,
+
+        0,    0,  126,   81,  113,  151,   41,  129,  312,  156,
+      165,  174,  183,  192,  201,  210,  219,   40,  227,  227,
+      231,  240,  245,  253,  262,  271,  280,  285,  293,  302
     } ;
 
-static yyconst flex_int16_t yy_def[128] =
+static yyconst flex_int16_t yy_def[131] =
     {   0,
-      111,  111,  111,  111,  112,  112,  110,    7,  110,    9,
-      112,  112,  113,  113,  114,  114,  115,  115,  116,  116,
-      117,  117,  112,  112,  110,  110,  110,  110,  118,  110,
-      110,  110,  110,  110,  110,  119,  119,  110,  119,  119,
-      119,   41,  119,  119,  110,  110,  120,  110,  110,  121,
-      110,  110,  121,  110,  110,  110,  110,  110,  110,  122,
-      110,  110,  123,  110,  110,  110,  118,  118,  110,  110,
-      119,  110,  119,   37,  110,  110,   41,   42,  110,  119,
-      110,  120,  121,  110,  124,  110,  125,  122,  110,  123,
-      110,  126,  110,  126,  126,  110,  124,  125,  127,  127,
-
-      127,  127,   97,  127,  127,  105,  105,   97,  127,    0,
-      110,  110,  110,  110,  110,  110,  110,  110,  110,  110,
-      110,  110,  110,  110,  110,  110,  110
+      110,  110,  110,  110,  111,  111,  109,    7,  112,  112,
+      109,   11,  111,  111,  113,  113,  114,  114,  115,  115,
+      116,  116,  117,  117,  111,  111,  109,  109,  109,  109,
+      118,  109,  109,  109,  109,  109,  109,  119,  109,  109,
+      109,  120,  121,  109,  109,  122,  109,  122,  109,  109,
+      123,  109,  109,  124,  109,  109,  124,  109,  109,  109,
+      109,  109,  109,  125,  109,  109,  126,  109,  109,  109,
+      118,  118,  109,  109,  119,  109,  109,  120,  121,  109,
+      109,  122,  109,  122,  109,  109,  123,  124,  109,  127,
+      109,  128,  125,  109,  126,  109,  109,  129,  109,  127,
+
+      128,  130,  130,  100,  130,  130,  100,  130,    0,  109,
+      109,  109,  109,  109,  109,  109,  109,  109,  109,  109,
+      109,  109,  109,  109,  109,  109,  109,  109,  109,  109
     } ;
 
-static yyconst flex_int16_t yy_nxt[271] =
+static yyconst flex_int16_t yy_nxt[330] =
     {   0,
-      110,  110,   27,   28,   27,   28,   27,   28,   27,   49,
-       27,   49,   51,   52,   55,   56,   29,   30,   31,   55,
-       56,   55,   58,   61,   62,   61,   62,   64,   65,   29,
-       33,   34,   64,   65,   27,   49,   27,   49,   67,   35,
-       33,   34,   72,   73,   75,   76,   73,   75,  108,   35,
-       36,   37,   38,   39,   37,   40,   41,   42,   42,   36,
-       42,   36,   43,   44,   42,   41,   37,   32,   32,   45,
-       46,   47,   48,   47,   47,   47,   47,   47,   47,   47,
-       47,   47,   32,   32,   51,   52,   72,   73,  108,   53,
-       55,   58,   79,   80,   68,   59,   74,   72,   73,   74,
-
-       72,   73,   72,   73,   92,   93,   73,   92,   96,   73,
-       91,   74,   72,   73,   72,  109,   77,   77,   77,   75,
-       77,   89,   75,   87,   77,   77,   78,   78,   94,   78,
-       86,   94,   95,   78,   86,   95,   83,   83,   85,  100,
-       92,   83,  100,   92,  101,  102,   95,  101,  102,   95,
-       84,   83,   83,   83,   83,   66,  105,   81,   83,  105,
-      103,  106,  107,  106,  106,  107,  106,   70,   83,   83,
-      105,   72,  109,  105,  107,   93,  109,  107,   26,   26,
-       26,   26,   26,   32,   32,   32,   32,   32,   50,   50,
-       50,   50,   50,   54,   54,   54,   54,   54,   57,   57,
-
-       57,   57,   57,   60,   60,   60,   60,   60,   63,   63,
-       63,   63,   63,   71,   71,   71,   71,   71,   82,   82,
-       83,   69,   68,   83,   83,   88,   66,  110,   88,   88,
-       90,  110,  110,   90,   90,   97,  110,  110,   97,   97,
-       98,   98,   99,  110,   99,   99,   99,  104,  110,  104,
-      104,  104,   25,  110,  110,  110,  110,  110,  110,  110,
-      110,  110,  110,  110,  110,  110,  110,  110,  110,  110
+      109,  109,   29,   30,   29,   30,   29,   30,   47,   48,
+       47,   48,   29,   53,   29,   53,   31,   32,   33,   55,
+       56,   59,   60,   59,   60,   59,   62,   65,   66,   31,
+       35,   36,   65,   66,   68,   69,   68,   69,   78,   37,
+       35,   36,   29,   53,   29,   53,   71,   78,  107,   37,
+       34,   38,   39,   40,   38,   41,   42,   43,   43,   34,
+       43,   34,   44,   45,   43,   42,   38,   34,   34,   49,
+       50,   51,   52,   51,   51,   51,   51,   51,   51,   51,
+       51,   51,   34,   34,   55,   56,   80,   81,  107,   57,
+       59,   62,   80,   76,   78,   63,   76,   83,   84,   85,
+
+       84,   76,   76,   78,   76,   76,   97,   83,   84,   97,
+       98,   99,   84,   98,   98,   83,  108,   98,   88,   88,
+       72,   97,  103,   88,   97,  103,   98,  106,   96,   98,
+      106,   99,  108,   88,   88,   88,   88,   94,   92,   91,
+       88,   91,  104,   90,   89,   70,   86,   77,   74,   73,
+       88,   88,  106,   83,  108,  106,   28,   28,   28,   28,
+       28,   28,   28,   28,   28,   34,   34,   34,   34,   34,
+       34,   34,   34,   34,   46,   46,   46,   46,   46,   46,
+       46,   46,   46,   54,   54,   54,   54,   54,   54,   54,
+       54,   54,   58,   58,   58,   58,   58,   58,   58,   58,
+
+       58,   61,   61,   61,   61,   61,   61,   61,   61,   61,
+       64,   64,   64,   64,   64,   64,   64,   64,   64,   67,
+       67,   67,   67,   67,   67,   67,   67,   67,   75,   72,
+       70,   75,   78,   78,  109,   78,   79,   79,  109,   79,
+       82,   82,   82,   82,   82,   82,   82,   82,   82,   87,
+       87,   87,   87,   88,   88,  109,  109,   88,   88,   88,
+       88,   88,   93,   93,  109,  109,   93,   93,   93,   93,
+       93,   95,   95,  109,  109,   95,   95,   95,   95,   95,
+      100,  100,  109,  109,  100,  100,  100,  100,  100,  101,
+      101,  101,  101,  102,  102,  109,  102,  102,  102,  102,
+
+      102,  102,  105,  105,  109,  105,  105,  105,  105,  105,
+      105,   27,  109,  109,  109,  109,  109,  109,  109,  109,
+      109,  109,  109,  109,  109,  109,  109,  109,  109
     } ;
 
-static yyconst flex_int16_t yy_chk[271] =
+static yyconst flex_int16_t yy_chk[330] =
     {   0,
-        0,    0,    1,    1,    2,    2,    3,    3,   11,   11,
-       12,   12,   13,   13,   15,   15,    2,    4,    4,   16,
-       16,   17,   17,   19,   19,   20,   20,   21,   21,    4,
-        5,    5,   22,   22,   23,   23,   24,   24,  118,    5,
-        6,    6,   36,   36,   38,   39,   39,   38,  108,    6,
+        0,    0,    1,    1,    2,    2,    3,    3,    9,    9,
+       10,   10,   13,   13,   14,   14,    2,    4,    4,   15,
+       15,   17,   17,   18,   18,   19,   19,   21,   21,    4,
+        5,    5,   22,   22,   23,   23,   24,   24,   43,    5,
+        6,    6,   25,   25,   26,   26,  118,   43,  107,    6,
         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
-        7,    7,    7,    7,    7,    7,    7,    9,    9,    9,
-        9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
-        9,    9,    9,    9,   14,   14,   40,   40,  103,   14,
-       18,   18,   43,   43,   68,   18,   37,   37,   37,   37,
-
-       44,   44,   71,   71,   72,   73,   73,   72,   80,   80,
-       65,   37,   41,   41,  104,  104,   41,   41,   41,   75,
-       41,   62,   75,   59,   41,   41,   42,   42,   76,   42,
-       58,   76,   79,   42,   56,   79,   85,   85,   53,   92,
-       93,   85,   92,   93,   94,   95,   96,   94,   95,   96,
-       52,   85,   85,   97,   97,   49,  100,   46,   97,  100,
-       97,  101,  102,  106,  101,  102,  106,   34,   97,   97,
-      105,  105,  105,  105,  107,  109,  109,  107,  111,  111,
-      111,  111,  111,  112,  112,  112,  112,  112,  113,  113,
-      113,  113,  113,  114,  114,  114,  114,  114,  115,  115,
-
-      115,  115,  115,  116,  116,  116,  116,  116,  117,  117,
-      117,  117,  117,  119,  119,  119,  119,  119,  120,  120,
-      121,   31,   29,  121,  121,  122,   28,   25,  122,  122,
-      123,    0,    0,  123,  123,  124,    0,    0,  124,  124,
-      125,  125,  126,    0,  126,  126,  126,  127,    0,  127,
-      127,  127,  110,  110,  110,  110,  110,  110,  110,  110,
-      110,  110,  110,  110,  110,  110,  110,  110,  110,  110
+        7,    7,    7,    7,    7,    7,    7,   11,   11,   11,
+       11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
+       11,   11,   11,   11,   16,   16,   44,   44,  104,   16,
+       20,   20,   81,   39,   79,   20,   39,   46,   46,   48,
+
+       48,   76,   77,   79,   76,   77,   80,   82,   82,   80,
+       83,   84,   84,   83,   85,  105,  105,   85,   90,   90,
+       72,   97,   98,   90,   97,   98,   99,  103,   69,   99,
+      103,  108,  108,   90,   90,  100,  100,   66,   63,   62,
+      100,   60,  100,   57,   56,   53,   50,   40,   36,   33,
+      100,  100,  106,  106,  106,  106,  110,  110,  110,  110,
+      110,  110,  110,  110,  110,  111,  111,  111,  111,  111,
+      111,  111,  111,  111,  112,  112,  112,  112,  112,  112,
+      112,  112,  112,  113,  113,  113,  113,  113,  113,  113,
+      113,  113,  114,  114,  114,  114,  114,  114,  114,  114,
+
+      114,  115,  115,  115,  115,  115,  115,  115,  115,  115,
+      116,  116,  116,  116,  116,  116,  116,  116,  116,  117,
+      117,  117,  117,  117,  117,  117,  117,  117,  119,   31,
+       30,  119,  120,  120,   27,  120,  121,  121,    0,  121,
+      122,  122,  122,  122,  122,  122,  122,  122,  122,  123,
+      123,  123,  123,  124,  124,    0,    0,  124,  124,  124,
+      124,  124,  125,  125,    0,    0,  125,  125,  125,  125,
+      125,  126,  126,    0,    0,  126,  126,  126,  126,  126,
+      127,  127,    0,    0,  127,  127,  127,  127,  127,  128,
+      128,  128,  128,  129,  129,    0,  129,  129,  129,  129,
+
+      129,  129,  130,  130,    0,  130,  130,  130,  130,  130,
+      130,  109,  109,  109,  109,  109,  109,  109,  109,  109,
+      109,  109,  109,  109,  109,  109,  109,  109,  109
     } ;
 
 /* Table of booleans, true if rule could match eol. */
-static yyconst flex_int32_t yy_rule_can_match_eol[31] =
+static yyconst flex_int32_t yy_rule_can_match_eol[32] =
     {   0,
-0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 
-    0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0,     };
-
-#define REJECT \
-{ \
-*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ \
-yy_cp = yyg->yy_full_match; /* restore poss. backed-over text */ \
-++yyg->yy_lp; \
-goto find_rule; \
-}
-
+0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 
+    0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0,     };
+
+/* The intent behind this definition is that it'll catch
+ * any uses of REJECT which flex missed.
+ */
+#define REJECT reject_used_but_not_detected
 #define yymore() yymore_used_but_not_detected
 #define YY_MORE_ADJ 0
 #define YY_RESTORE_YY_MORE_OFFSET
@@ -606,6 +592,8 @@
 #include "mimeparser.h"
 #include "mimeparser.tab.h"
 
+void yy_fatal_error2( char *msg , void *yyscanner);
+
 #define NAMEOF(v) #v
 /* BC() is a debug wrapper for lex' BEGIN() macro */
 #define BC(x) do { \
@@ -616,9 +604,9 @@
 
 #define ZERO(x) memset(x, '\0', sizeof(x))
 
-#define PREALLOC_BUFFER	100000
-#undef YY_BUF_SIZE
-#define YY_BUF_SIZE 562072
+#define YY_FATAL_ERROR(msg) { yy_fatal_error2( msg , yyscanner); return EOF; }
+#define YY_FATAL_ERROR2(msg) { yy_fatal_error2( msg , yyscanner); return; }
+#define YY_FATAL_ERROR3(msg) { yy_fatal_error2( msg , yyscanner); return NULL; }
 
 enum header_states
 {
@@ -642,20 +630,22 @@
 
 
 
-#line 646 "mimeparser.yy.c"
+
+#line 635 "mimeparser.yy.c"
 
 #define INITIAL 0
 #define headers 1
 #define header 2
 #define headervalue 3
-#define tspecialvalue 4
-#define comment 5
-#define body 6
-#define postamble 7
-#define preamble 8
-#define boundary 9
-#define endboundary 10
-#define endoffile 11
+#define headervalue2 4
+#define tspecialvalue 5
+#define comment 6
+#define body 7
+#define postamble 8
+#define preamble 9
+#define boundary 10
+#define endboundary 11
+#define endoffile 12
 
 /* Special case for "unistd.h", since it is non-ANSI. We include it way
  * down here because we want the user's section 1 to have been scanned first.
@@ -694,11 +684,6 @@
 
     int yylineno_r;
     int yy_flex_debug_r;
-
-    yy_state_type *yy_state_buf;
-    yy_state_type *yy_state_ptr;
-    char *yy_full_match;
-    int yy_lp;
 
     char *yytext_r;
     int yy_more_flag;
@@ -884,10 +869,10 @@
 	register int yy_act;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
-#line 95 "mimeparser.l"
-
-
-#line 891 "mimeparser.yy.c"
+#line 98 "mimeparser.l"
+
+
+#line 876 "mimeparser.yy.c"
 
     yylval = yylval_param;
 
@@ -898,9 +883,6 @@
 #ifdef YY_USER_INIT
 		YY_USER_INIT;
 #endif
-
-        if ( ! yyg->yy_state_buf )
-            yyg->yy_state_buf = (yy_state_type *)mimeparser_yyalloc(YY_BUF_SIZE + 2  ,yyscanner);
 
 		if ( ! yyg->yy_start )
 			yyg->yy_start = 1;	/* first start state */
@@ -934,43 +916,33 @@
 
 		yy_current_state = yyg->yy_start;
 		yy_current_state += YY_AT_BOL();
-
-		yyg->yy_state_ptr = yyg->yy_state_buf;
-		*yyg->yy_state_ptr++ = yy_current_state;
-
 yy_match:
 		do
 			{
 			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+			if ( yy_accept[yy_current_state] )
+				{
+				yyg->yy_last_accepting_state = yy_current_state;
+				yyg->yy_last_accepting_cpos = yy_cp;
+				}
 			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 				{
 				yy_current_state = (int) yy_def[yy_current_state];
-				if ( yy_current_state >= 111 )
+				if ( yy_current_state >= 110 )
 					yy_c = yy_meta[(unsigned int) yy_c];
 				}
 			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-			*yyg->yy_state_ptr++ = yy_current_state;
 			++yy_cp;
 			}
-		while ( yy_base[yy_current_state] != 253 );
+		while ( yy_base[yy_current_state] != 312 );
 
 yy_find_action:
-		yy_current_state = *--yyg->yy_state_ptr;
-		yyg->yy_lp = yy_accept[yy_current_state];
-find_rule: /* we branch to this label when backing up */
-		for ( ; ; ) /* until we find what rule we matched */
-			{
-			if ( yyg->yy_lp && yyg->yy_lp < yy_accept[yy_current_state + 1] )
-				{
-				yy_act = yy_acclist[yyg->yy_lp];
-					{
-					yyg->yy_full_match = yy_cp;
-					break;
-					}
-				}
-			--yy_cp;
-			yy_current_state = *--yyg->yy_state_ptr;
-			yyg->yy_lp = yy_accept[yy_current_state];
+		yy_act = yy_accept[yy_current_state];
+		if ( yy_act == 0 )
+			{ /* have to back up */
+			yy_cp = yyg->yy_last_accepting_cpos;
+			yy_current_state = yyg->yy_last_accepting_state;
+			yy_act = yy_accept[yy_current_state];
 			}
 
 		YY_DO_BEFORE_ACTION;
@@ -991,9 +963,16 @@
 
 		switch ( yy_act )
 	{ /* beginning of action switch */
+			case 0: /* must back up */
+			/* undo the effects of YY_DO_BEFORE_ACTION */
+			*yy_cp = yyg->yy_hold_char;
+			yy_cp = yyg->yy_last_accepting_cpos;
+			yy_current_state = yyg->yy_last_accepting_state;
+			goto yy_find_action;
+
 case 1:
 YY_RULE_SETUP
-#line 97 "mimeparser.l"
+#line 100 "mimeparser.l"
 {
 	yylval_param->string=strdup(yytext); 
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
@@ -1023,7 +1002,7 @@
 	YY_BREAK
 case 2:
 YY_RULE_SETUP
-#line 124 "mimeparser.l"
+#line 127 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	/* dprintf2("Unknown header char: %c\n", *yytext); */
@@ -1034,7 +1013,7 @@
 case 3:
 /* rule 3 can match eol */
 YY_RULE_SETUP
-#line 131 "mimeparser.l"
+#line 134 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	lstate->lineno++; 
@@ -1059,10 +1038,14 @@
 	YY_BREAK
 case 4:
 YY_RULE_SETUP
-#line 153 "mimeparser.l"
-{
-	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
-	BC(headervalue); 
+#line 156 "mimeparser.l"
+{
+	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
+	if (lstate->header_state == STATE_MAIL || lstate->header_state == STATE_CENC) {
+		BC(headervalue2);
+	} else {
+		BC(headervalue);
+	}
 	lstate->current_pos += yyleng;
 	return COLON;
 }	
@@ -1070,7 +1053,7 @@
 case 5:
 /* rule 5 can match eol */
 YY_RULE_SETUP
-#line 160 "mimeparser.l"
+#line 167 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	BC(headers);
@@ -1082,7 +1065,7 @@
 case 6:
 /* rule 6 can match eol */
 YY_RULE_SETUP
-#line 168 "mimeparser.l"
+#line 175 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	lstate->current_pos += yyleng;
@@ -1091,12 +1074,9 @@
 case 7:
 /* rule 7 can match eol */
 YY_RULE_SETUP
-#line 173 "mimeparser.l"
-{
-	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
-	if (lstate->header_state != STATE_MAIL && lstate->header_state != STATE_CENC) {
-		REJECT;
-	}
+#line 180 "mimeparser.l"
+{
+	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	lstate->current_pos += yyleng;
 	while (*yytext && isspace(*yytext)) yytext++;
 	/* Do we actually have a header value? */
@@ -1105,14 +1085,14 @@
 	} else {
 		yylval_param->string=strdup(yytext); 
 		lstate->lineno += count_lines(yytext);
-	}	
+	}
 	return WORD;
 }
 	YY_BREAK
 case 8:
 /* rule 8 can match eol */
 YY_RULE_SETUP
-#line 190 "mimeparser.l"
+#line 194 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	/* marks the end of one header line */
@@ -1125,7 +1105,20 @@
 case 9:
 /* rule 9 can match eol */
 YY_RULE_SETUP
-#line 199 "mimeparser.l"
+#line 203 "mimeparser.l"
+{
+	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
+	/* marks the end of one header line */
+	lstate->lineno++;
+	BC(headers);
+	lstate->current_pos += yyleng;
+	return EOL;
+}
+	YY_BREAK
+case 10:
+/* rule 10 can match eol */
+YY_RULE_SETUP
+#line 212 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	lstate->lineno += count_lines(yytext);
@@ -1133,18 +1126,18 @@
 	return SEMICOLON;
 }
 	YY_BREAK
-case 10:
-YY_RULE_SETUP
-#line 206 "mimeparser.l"
+case 11:
+YY_RULE_SETUP
+#line 219 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	lstate->current_pos += yyleng;
 	return EQUAL;
 }
 	YY_BREAK
-case 11:
-YY_RULE_SETUP
-#line 212 "mimeparser.l"
+case 12:
+YY_RULE_SETUP
+#line 225 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	BC(tspecialvalue);
@@ -1152,9 +1145,9 @@
 	return *yytext;
 }
 	YY_BREAK
-case 12:
-YY_RULE_SETUP
-#line 219 "mimeparser.l"
+case 13:
+YY_RULE_SETUP
+#line 232 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	yylval_param->string=strdup(yytext);
@@ -1163,17 +1156,17 @@
 	return WORD;
 }
 	YY_BREAK
-case 13:
-YY_RULE_SETUP
-#line 227 "mimeparser.l"
+case 14:
+YY_RULE_SETUP
+#line 240 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	lstate->current_pos += yyleng;
 }	
 	YY_BREAK
-case 14:
-YY_RULE_SETUP
-#line 232 "mimeparser.l"
+case 15:
+YY_RULE_SETUP
+#line 245 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	lstate->lineno += count_lines(yytext);
@@ -1182,9 +1175,9 @@
 	return TSPECIAL;
 }
 	YY_BREAK
-case 15:
-YY_RULE_SETUP
-#line 240 "mimeparser.l"
+case 16:
+YY_RULE_SETUP
+#line 253 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	BC(headervalue);
@@ -1192,9 +1185,9 @@
 	return *yytext;
 }
 	YY_BREAK
-case 16:
-YY_RULE_SETUP
-#line 247 "mimeparser.l"
+case 17:
+YY_RULE_SETUP
+#line 260 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	/**
@@ -1207,7 +1200,8 @@
 	if (lstate->endboundary_string != NULL) {
 		if (strcmp(lstate->endboundary_string, yytext)) {
 			/* dprintf2("YYTEXT != end_boundary: '%s'\n", yytext); */
-			REJECT;
+			lstate->current_pos += yyleng;
+			/* REJECT; no-- just let it be absorbed into the body */
 		} else {
 			lstate->current_pos += yyleng;
 			/* dprintf2("YYTEXT == lstate->end_boundary: '%s'\n", yytext); */
@@ -1222,17 +1216,15 @@
 				yyless(0);
 				BC(endboundary);
 				return BODY;
-			}	
-		}
+			}
+        }	
 	} else {
 	}	
-
-	REJECT;
-}
-	YY_BREAK
-case 17:
-YY_RULE_SETUP
-#line 282 "mimeparser.l"
+}
+	YY_BREAK
+case 18:
+YY_RULE_SETUP
+#line 294 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	/**
@@ -1242,7 +1234,8 @@
 	if (lstate->boundary_string != NULL) {
 		if (strcmp(lstate->boundary_string, yytext)) {
 			/* dprintf2("YYTEXT != boundary: '%s'\n", yytext);*/
-			REJECT;
+			lstate->current_pos += yyleng;
+			/* REJECT; no-- just let it be absorbed into the body */
 		} else {
 			/* dprintf2("YYTEXT == boundary: '%s'\n", yytext);*/
 			if (lstate->body_start) {
@@ -1268,42 +1261,40 @@
 				lstate->current_pos += yyleng;
 				return(BOUNDARY);
 			}
-		}
+	   }
 	} else {
 	}	
-
-	REJECT;
-}
-	YY_BREAK
-case 18:
-/* rule 18 can match eol */
-YY_RULE_SETUP
-#line 324 "mimeparser.l"
+}
+	YY_BREAK
+case 19:
+/* rule 19 can match eol */
+YY_RULE_SETUP
+#line 335 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	lstate->current_pos += yyleng;
 	lstate->lineno++;
 }
 	YY_BREAK
-case 19:
-YY_RULE_SETUP
-#line 330 "mimeparser.l"
+case 20:
+YY_RULE_SETUP
+#line 341 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	lstate->current_pos += yyleng;
 	/* dprintf2("stray CR in body...\n"); */
 }
 	YY_BREAK
-case 20:
-YY_RULE_SETUP
-#line 336 "mimeparser.l"
+case 21:
+YY_RULE_SETUP
+#line 347 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	lstate->current_pos += yyleng;
 }
 	YY_BREAK
 case YY_STATE_EOF(body):
-#line 341 "mimeparser.l"
+#line 352 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	if (lstate->boundary_string == NULL && lstate->body_start) {
@@ -1318,10 +1309,10 @@
 	yyterminate();
 }	
 	YY_BREAK
-case 21:
-/* rule 21 can match eol */
-YY_RULE_SETUP
-#line 355 "mimeparser.l"
+case 22:
+/* rule 22 can match eol */
+YY_RULE_SETUP
+#line 366 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	/* dprintf2("Preamble CR/LF at line %d\n", lineno); */
@@ -1329,9 +1320,9 @@
 	lstate->current_pos += yyleng;
 }	
 	YY_BREAK
-case 22:
-YY_RULE_SETUP
-#line 362 "mimeparser.l"
+case 23:
+YY_RULE_SETUP
+#line 373 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	yylval_param->string = strdup(yytext);
@@ -1339,9 +1330,9 @@
 	return BOUNDARY;
 }
 	YY_BREAK
-case 23:
-YY_RULE_SETUP
-#line 369 "mimeparser.l"
+case 24:
+YY_RULE_SETUP
+#line 380 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	yylval_param->string = strdup(yytext);
@@ -1349,10 +1340,10 @@
 	return ENDBOUNDARY;
 }
 	YY_BREAK
-case 24:
-/* rule 24 can match eol */
-YY_RULE_SETUP
-#line 376 "mimeparser.l"
+case 25:
+/* rule 25 can match eol */
+YY_RULE_SETUP
+#line 387 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	BC(headers);
@@ -1362,10 +1353,10 @@
 	return EOL;
 }
 	YY_BREAK
-case 25:
-/* rule 25 can match eol */
-YY_RULE_SETUP
-#line 385 "mimeparser.l"
+case 26:
+/* rule 26 can match eol */
+YY_RULE_SETUP
+#line 396 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	BC(postamble);
@@ -1373,26 +1364,26 @@
 	lstate->current_pos += yyleng;
 }
 	YY_BREAK
-case 26:
-YY_RULE_SETUP
-#line 392 "mimeparser.l"
-{
-	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
-	lstate->current_pos += yyleng;
-}
-	YY_BREAK
 case 27:
 YY_RULE_SETUP
-#line 398 "mimeparser.l"
+#line 403 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	lstate->current_pos += yyleng;
 }
 	YY_BREAK
 case 28:
-/* rule 28 can match eol */
-YY_RULE_SETUP
-#line 403 "mimeparser.l"
+YY_RULE_SETUP
+#line 409 "mimeparser.l"
+{
+	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
+	lstate->current_pos += yyleng;
+}
+	YY_BREAK
+case 29:
+/* rule 29 can match eol */
+YY_RULE_SETUP
+#line 414 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	lstate->lineno++;
@@ -1400,33 +1391,34 @@
 	return EOL;
 }
 	YY_BREAK
-case 29:
-YY_RULE_SETUP
-#line 410 "mimeparser.l"
+case 30:
+YY_RULE_SETUP
+#line 421 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	lstate->current_pos += yyleng;
 	return((int)*yytext);
 }
 	YY_BREAK
-case 30:
-YY_RULE_SETUP
-#line 417 "mimeparser.l"
+case 31:
+YY_RULE_SETUP
+#line 428 "mimeparser.l"
 ECHO;
 	YY_BREAK
-#line 1418 "mimeparser.yy.c"
-			case YY_STATE_EOF(INITIAL):
-			case YY_STATE_EOF(headers):
-			case YY_STATE_EOF(header):
-			case YY_STATE_EOF(headervalue):
-			case YY_STATE_EOF(tspecialvalue):
-			case YY_STATE_EOF(comment):
-			case YY_STATE_EOF(postamble):
-			case YY_STATE_EOF(preamble):
-			case YY_STATE_EOF(boundary):
-			case YY_STATE_EOF(endboundary):
-			case YY_STATE_EOF(endoffile):
-				yyterminate();
+#line 1409 "mimeparser.yy.c"
+case YY_STATE_EOF(INITIAL):
+case YY_STATE_EOF(headers):
+case YY_STATE_EOF(header):
+case YY_STATE_EOF(headervalue):
+case YY_STATE_EOF(headervalue2):
+case YY_STATE_EOF(tspecialvalue):
+case YY_STATE_EOF(comment):
+case YY_STATE_EOF(postamble):
+case YY_STATE_EOF(preamble):
+case YY_STATE_EOF(boundary):
+case YY_STATE_EOF(endboundary):
+case YY_STATE_EOF(endoffile):
+	yyterminate();
 
 	case YY_END_OF_BUFFER:
 		{
@@ -1617,8 +1609,37 @@
 		while ( num_to_read <= 0 )
 			{ /* Not enough room in the buffer - grow it. */
 
-			YY_FATAL_ERROR(
-"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
+			/* just a shorter name for the current buffer */
+			YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+
+			int yy_c_buf_p_offset =
+				(int) (yyg->yy_c_buf_p - b->yy_ch_buf);
+
+			if ( b->yy_is_our_buffer )
+				{
+				int new_size = b->yy_buf_size * 2;
+
+				if ( new_size <= 0 )
+					b->yy_buf_size += b->yy_buf_size / 8;
+				else
+					b->yy_buf_size *= 2;
+
+				b->yy_ch_buf = (char *)
+					/* Include room in for 2 EOB chars. */
+					mimeparser_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
+				}
+			else
+				/* Can't grow it, we don't own it. */
+				b->yy_ch_buf = 0;
+
+			if ( ! b->yy_ch_buf )
+				YY_FATAL_ERROR(

[... 167 lines stripped ...]


More information about the asterisk-commits mailing list