Permalink
Browse files

MFH: Fixed #45384 (parse_ini_file will result in parse error with no …

…trailing

 newline)
  • Loading branch information...
1 parent 13d7bb0 commit 1defd7a9e2464c109354c6db37f08c1f77db9b7c @arnaud-lb arnaud-lb committed Aug 17, 2008
Showing with 126 additions and 120 deletions.
  1. +2 −0 NEWS
  2. +118 −116 Zend/zend_ini_scanner.c
  3. +5 −3 Zend/zend_ini_scanner.l
  4. +1 −1 Zend/zend_ini_scanner_defs.h
View
2 NEWS
@@ -34,6 +34,8 @@ PHP NEWS
(Derick)
- Fixed bug #45447 (Filesystem time functions on Vista and server 2008).
(Pierre)
+- Fixed bug #45384 (parse_ini_file will result in parse error with no trailing
+ newline). (Arnaud)
- Fixed bug #45044 (relative paths not resolved correctly). (Dmitry)
- Fixed bug #44925 (preg_grep() modifies input array). (Nuno)
- Fixed bug #44100 (Inconsistent handling of static array declarations with
View
234 Zend/zend_ini_scanner.c
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.6.dev on Thu Aug 7 13:22:08 2008 */
+/* Generated by re2c 0.13.5 on Sun Aug 17 22:48:22 2008 */
#line 1 "Zend/zend_ini_scanner.l"
/*
+----------------------------------------------------------------------+
@@ -39,7 +39,9 @@
#include "zend_ini_scanner_defs.h"
#define YYCTYPE unsigned char
-#define YYFILL(n) { if (YYCURSOR >= YYLIMIT) return 0; }
+/* allow the scanner to read one null byte after the end of the string (from ZEND_MMAP_AHEAD)
+ * so that if will be able to terminate to match the current token (e.g. non-enclosed string) */
+#define YYFILL(n) { if (YYCURSOR > YYLIMIT) return 0; }
#define YYCURSOR SCNG(yy_cursor)
#define YYLIMIT SCNG(yy_limit)
#define YYMARKER SCNG(yy_marker)
@@ -60,8 +62,8 @@
/* perform sanity check. If this message is triggered you should
increase the ZEND_MMAP_AHEAD value in the zend_streams.h file */
#define YYMAXFILL 6
-#if ZEND_MMAP_AHEAD < YYMAXFILL
-# error ZEND_MMAP_AHEAD should be greater than or equal to YYMAXFILL
+#if ZEND_MMAP_AHEAD < (YYMAXFILL + 1)
+# error ZEND_MMAP_AHEAD should be greater than YYMAXFILL
#endif
@@ -303,7 +305,7 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
}
-#line 307 "Zend/zend_ini_scanner.c"
+#line 309 "Zend/zend_ini_scanner.c"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
@@ -480,11 +482,11 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
++YYCURSOR;
YYDEBUG(3, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 493 "Zend/zend_ini_scanner.l"
+#line 495 "Zend/zend_ini_scanner.l"
{
return 0;
}
-#line 488 "Zend/zend_ini_scanner.c"
+#line 490 "Zend/zend_ini_scanner.c"
yy4:
YYDEBUG(4, *YYCURSOR);
yyaccept = 0;
@@ -493,24 +495,24 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy5:
YYDEBUG(5, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 472 "Zend/zend_ini_scanner.l"
+#line 474 "Zend/zend_ini_scanner.l"
{
/* eat whitespace */
goto restart;
}
-#line 502 "Zend/zend_ini_scanner.c"
+#line 504 "Zend/zend_ini_scanner.c"
yy6:
YYDEBUG(6, *YYCURSOR);
++YYCURSOR;
yy7:
YYDEBUG(7, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 477 "Zend/zend_ini_scanner.l"
+#line 479 "Zend/zend_ini_scanner.l"
{
SCNG(lineno)++;
return END_OF_LINE;
}
-#line 514 "Zend/zend_ini_scanner.c"
+#line 516 "Zend/zend_ini_scanner.c"
yy8:
YYDEBUG(8, *YYCURSOR);
yych = *++YYCURSOR;
@@ -521,11 +523,11 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
++YYCURSOR;
YYDEBUG(10, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 431 "Zend/zend_ini_scanner.l"
+#line 433 "Zend/zend_ini_scanner.l"
{ /* Disallow these chars outside option values */
return yytext[0];
}
-#line 529 "Zend/zend_ini_scanner.c"
+#line 531 "Zend/zend_ini_scanner.c"
yy11:
YYDEBUG(11, *YYCURSOR);
++YYCURSOR;
@@ -534,11 +536,11 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy12:
YYDEBUG(12, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 391 "Zend/zend_ini_scanner.l"
+#line 393 "Zend/zend_ini_scanner.l"
{ /* Get option name */
RETURN_TOKEN(TC_LABEL, yytext, yyleng);
}
-#line 542 "Zend/zend_ini_scanner.c"
+#line 544 "Zend/zend_ini_scanner.c"
yy13:
YYDEBUG(13, *YYCURSOR);
yyaccept = 1;
@@ -552,7 +554,7 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy15:
YYDEBUG(15, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 395 "Zend/zend_ini_scanner.l"
+#line 397 "Zend/zend_ini_scanner.l"
{ /* Start option value */
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) {
yy_push_state(ST_RAW TSRMLS_CC);
@@ -561,7 +563,7 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
}
return '=';
}
-#line 565 "Zend/zend_ini_scanner.c"
+#line 567 "Zend/zend_ini_scanner.c"
yy16:
YYDEBUG(16, *YYCURSOR);
yych = *++YYCURSOR;
@@ -617,7 +619,7 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
++YYCURSOR;
YYDEBUG(22, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 329 "Zend/zend_ini_scanner.l"
+#line 331 "Zend/zend_ini_scanner.l"
{ /* Section start */
/* Enter section data lookup state */
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) {
@@ -627,7 +629,7 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
}
return TC_SECTION;
}
-#line 631 "Zend/zend_ini_scanner.c"
+#line 633 "Zend/zend_ini_scanner.c"
yy23:
YYDEBUG(23, *YYCURSOR);
++YYCURSOR;
@@ -657,7 +659,7 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
}
YYDEBUG(28, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 354 "Zend/zend_ini_scanner.l"
+#line 356 "Zend/zend_ini_scanner.l"
{ /* Start of option with offset */
/* Eat trailing whitespace and [ */
EAT_TRAILING_WHITESPACE_EX('[');
@@ -667,7 +669,7 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
RETURN_TOKEN(TC_OFFSET, yytext, yyleng);
}
-#line 671 "Zend/zend_ini_scanner.c"
+#line 673 "Zend/zend_ini_scanner.c"
yy29:
YYDEBUG(29, *YYCURSOR);
++YYCURSOR;
@@ -679,11 +681,11 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy30:
YYDEBUG(30, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 383 "Zend/zend_ini_scanner.l"
+#line 385 "Zend/zend_ini_scanner.l"
{ /* TRUE value (when used outside option value/offset this causes parse error!) */
RETURN_TOKEN(BOOL_TRUE, "1", 1);
}
-#line 687 "Zend/zend_ini_scanner.c"
+#line 689 "Zend/zend_ini_scanner.c"
yy31:
YYDEBUG(31, *YYCURSOR);
++YYCURSOR;
@@ -721,11 +723,11 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy37:
YYDEBUG(37, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 387 "Zend/zend_ini_scanner.l"
+#line 389 "Zend/zend_ini_scanner.l"
{ /* FALSE value (when used outside option value/offset this causes parse error!)*/
RETURN_TOKEN(BOOL_FALSE, "", 0);
}
-#line 729 "Zend/zend_ini_scanner.c"
+#line 731 "Zend/zend_ini_scanner.c"
yy38:
YYDEBUG(38, *YYCURSOR);
++YYCURSOR;
@@ -820,13 +822,13 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy52:
YYDEBUG(52, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 482 "Zend/zend_ini_scanner.l"
+#line 484 "Zend/zend_ini_scanner.l"
{ /* Comment */
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
}
-#line 830 "Zend/zend_ini_scanner.c"
+#line 832 "Zend/zend_ini_scanner.c"
yy53:
YYDEBUG(53, *YYCURSOR);
yych = *++YYCURSOR;
@@ -920,12 +922,12 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy61:
YYDEBUG(61, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 458 "Zend/zend_ini_scanner.l"
+#line 460 "Zend/zend_ini_scanner.l"
{ /* Escape double quoted string contents */
zend_ini_escape_string(ini_lval, yytext, yyleng, '"' TSRMLS_CC);
return TC_QUOTED_STRING;
}
-#line 929 "Zend/zend_ini_scanner.c"
+#line 931 "Zend/zend_ini_scanner.c"
yy62:
YYDEBUG(62, *YYCURSOR);
++YYCURSOR;
@@ -934,12 +936,12 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy63:
YYDEBUG(63, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 463 "Zend/zend_ini_scanner.l"
+#line 465 "Zend/zend_ini_scanner.l"
{ /* Double quoted '"' string ends */
yy_pop_state(TSRMLS_C);
return '"';
}
-#line 943 "Zend/zend_ini_scanner.c"
+#line 945 "Zend/zend_ini_scanner.c"
yy64:
YYDEBUG(64, *YYCURSOR);
++YYCURSOR;
@@ -954,11 +956,11 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy65:
YYDEBUG(65, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 493 "Zend/zend_ini_scanner.l"
+#line 495 "Zend/zend_ini_scanner.l"
{
return 0;
}
-#line 962 "Zend/zend_ini_scanner.c"
+#line 964 "Zend/zend_ini_scanner.c"
yy66:
YYDEBUG(66, *YYCURSOR);
yych = *++YYCURSOR;
@@ -1043,12 +1045,12 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
++YYCURSOR;
YYDEBUG(79, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 369 "Zend/zend_ini_scanner.l"
+#line 371 "Zend/zend_ini_scanner.l"
{ /* Variable start */
yy_push_state(ST_VARNAME TSRMLS_CC);
return TC_DOLLAR_CURLY;
}
-#line 1052 "Zend/zend_ini_scanner.c"
+#line 1054 "Zend/zend_ini_scanner.c"
yy80:
YYDEBUG(80, *YYCURSOR);
++YYCURSOR;
@@ -1147,11 +1149,11 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy85:
YYDEBUG(85, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 449 "Zend/zend_ini_scanner.l"
+#line 451 "Zend/zend_ini_scanner.l"
{ /* Get rest as section/offset value */
RETURN_TOKEN(TC_STRING, yytext, yyleng);
}
-#line 1155 "Zend/zend_ini_scanner.c"
+#line 1157 "Zend/zend_ini_scanner.c"
yy86:
YYDEBUG(86, *YYCURSOR);
yyaccept = 0;
@@ -1168,23 +1170,23 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy88:
YYDEBUG(88, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 493 "Zend/zend_ini_scanner.l"
+#line 495 "Zend/zend_ini_scanner.l"
{
return 0;
}
-#line 1176 "Zend/zend_ini_scanner.c"
+#line 1178 "Zend/zend_ini_scanner.c"
yy89:
YYDEBUG(89, *YYCURSOR);
++YYCURSOR;
yy90:
YYDEBUG(90, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 453 "Zend/zend_ini_scanner.l"
+#line 455 "Zend/zend_ini_scanner.l"
{ /* Double quoted '"' string start */
yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC);
return '"';
}
-#line 1188 "Zend/zend_ini_scanner.c"
+#line 1190 "Zend/zend_ini_scanner.c"
yy91:
YYDEBUG(91, *YYCURSOR);
yych = *++YYCURSOR;
@@ -1246,11 +1248,11 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy96:
YYDEBUG(96, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 427 "Zend/zend_ini_scanner.l"
+#line 429 "Zend/zend_ini_scanner.l"
{ /* Get number option value as string */
RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
}
-#line 1254 "Zend/zend_ini_scanner.c"
+#line 1256 "Zend/zend_ini_scanner.c"
yy97:
YYDEBUG(97, *YYCURSOR);
yyaccept = 3;
@@ -1276,11 +1278,11 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy98:
YYDEBUG(98, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 423 "Zend/zend_ini_scanner.l"
+#line 425 "Zend/zend_ini_scanner.l"
{ /* Get constant option value */
RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
}
-#line 1284 "Zend/zend_ini_scanner.c"
+#line 1286 "Zend/zend_ini_scanner.c"
yy99:
YYDEBUG(99, *YYCURSOR);
yych = *++YYCURSOR;
@@ -1291,12 +1293,12 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy101:
YYDEBUG(101, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 364 "Zend/zend_ini_scanner.l"
+#line 366 "Zend/zend_ini_scanner.l"
{ /* End of section or an option offset */
BEGIN(INITIAL);
return ']';
}
-#line 1300 "Zend/zend_ini_scanner.c"
+#line 1302 "Zend/zend_ini_scanner.c"
yy102:
YYDEBUG(102, *YYCURSOR);
yyaccept = 0;
@@ -1586,7 +1588,7 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
++YYCURSOR;
YYDEBUG(126, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 339 "Zend/zend_ini_scanner.l"
+#line 341 "Zend/zend_ini_scanner.l"
{ /* Raw string */
/* Eat leading and trailing single quotes */
if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') {
@@ -1595,18 +1597,18 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
}
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
-#line 1599 "Zend/zend_ini_scanner.c"
+#line 1601 "Zend/zend_ini_scanner.c"
yy127:
YYDEBUG(127, *YYCURSOR);
++YYCURSOR;
YYDEBUG(128, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 369 "Zend/zend_ini_scanner.l"
+#line 371 "Zend/zend_ini_scanner.l"
{ /* Variable start */
yy_push_state(ST_VARNAME TSRMLS_CC);
return TC_DOLLAR_CURLY;
}
-#line 1610 "Zend/zend_ini_scanner.c"
+#line 1612 "Zend/zend_ini_scanner.c"
yy129:
YYDEBUG(129, *YYCURSOR);
yyaccept = 0;
@@ -1713,7 +1715,7 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy136:
YYDEBUG(136, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 404 "Zend/zend_ini_scanner.l"
+#line 406 "Zend/zend_ini_scanner.l"
{ /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
/* Eat leading and trailing double quotes */
if (yytext[0] == '"' && yytext[yyleng - 1] == '"') {
@@ -1722,7 +1724,7 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
}
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
-#line 1726 "Zend/zend_ini_scanner.c"
+#line 1728 "Zend/zend_ini_scanner.c"
yy137:
YYDEBUG(137, *YYCURSOR);
yyaccept = 0;
@@ -1744,13 +1746,13 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy139:
YYDEBUG(139, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 417 "Zend/zend_ini_scanner.l"
+#line 419 "Zend/zend_ini_scanner.l"
{ /* End of option value */
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
}
-#line 1754 "Zend/zend_ini_scanner.c"
+#line 1756 "Zend/zend_ini_scanner.c"
yy140:
YYDEBUG(140, *YYCURSOR);
yych = *++YYCURSOR;
@@ -1764,12 +1766,12 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy142:
YYDEBUG(142, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 488 "Zend/zend_ini_scanner.l"
+#line 490 "Zend/zend_ini_scanner.l"
{ /* End of option value (if EOF is reached before EOL */
BEGIN(INITIAL);
return END_OF_LINE;
}
-#line 1773 "Zend/zend_ini_scanner.c"
+#line 1775 "Zend/zend_ini_scanner.c"
yy143:
YYDEBUG(143, *YYCURSOR);
yych = *++YYCURSOR;
@@ -1791,13 +1793,13 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy147:
YYDEBUG(147, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 482 "Zend/zend_ini_scanner.l"
+#line 484 "Zend/zend_ini_scanner.l"
{ /* Comment */
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
}
-#line 1801 "Zend/zend_ini_scanner.c"
+#line 1803 "Zend/zend_ini_scanner.c"
yy148:
YYDEBUG(148, *YYCURSOR);
yych = *++YYCURSOR;
@@ -1899,21 +1901,21 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy158:
YYDEBUG(158, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 413 "Zend/zend_ini_scanner.l"
+#line 415 "Zend/zend_ini_scanner.l"
{ /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
-#line 1907 "Zend/zend_ini_scanner.c"
+#line 1909 "Zend/zend_ini_scanner.c"
yy159:
YYDEBUG(159, *YYCURSOR);
++YYCURSOR;
YYDEBUG(160, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 493 "Zend/zend_ini_scanner.l"
+#line 495 "Zend/zend_ini_scanner.l"
{
return 0;
}
-#line 1917 "Zend/zend_ini_scanner.c"
+#line 1919 "Zend/zend_ini_scanner.c"
yy161:
YYDEBUG(161, *YYCURSOR);
++YYCURSOR;
@@ -1922,13 +1924,13 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy162:
YYDEBUG(162, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 348 "Zend/zend_ini_scanner.l"
+#line 350 "Zend/zend_ini_scanner.l"
{ /* End of section */
BEGIN(INITIAL);
SCNG(lineno)++;
return ']';
}
-#line 1932 "Zend/zend_ini_scanner.c"
+#line 1934 "Zend/zend_ini_scanner.c"
yy163:
YYDEBUG(163, *YYCURSOR);
++YYCURSOR;
@@ -2049,11 +2051,11 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy172:
YYDEBUG(172, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 449 "Zend/zend_ini_scanner.l"
+#line 451 "Zend/zend_ini_scanner.l"
{ /* Get rest as section/offset value */
RETURN_TOKEN(TC_STRING, yytext, yyleng);
}
-#line 2057 "Zend/zend_ini_scanner.c"
+#line 2059 "Zend/zend_ini_scanner.c"
yy173:
YYDEBUG(173, *YYCURSOR);
yyaccept = 0;
@@ -2072,23 +2074,23 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy175:
YYDEBUG(175, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 493 "Zend/zend_ini_scanner.l"
+#line 495 "Zend/zend_ini_scanner.l"
{
return 0;
}
-#line 2080 "Zend/zend_ini_scanner.c"
+#line 2082 "Zend/zend_ini_scanner.c"
yy176:
YYDEBUG(176, *YYCURSOR);
++YYCURSOR;
yy177:
YYDEBUG(177, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 453 "Zend/zend_ini_scanner.l"
+#line 455 "Zend/zend_ini_scanner.l"
{ /* Double quoted '"' string start */
yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC);
return '"';
}
-#line 2092 "Zend/zend_ini_scanner.c"
+#line 2094 "Zend/zend_ini_scanner.c"
yy178:
YYDEBUG(178, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2150,11 +2152,11 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy183:
YYDEBUG(183, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 427 "Zend/zend_ini_scanner.l"
+#line 429 "Zend/zend_ini_scanner.l"
{ /* Get number option value as string */
RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
}
-#line 2158 "Zend/zend_ini_scanner.c"
+#line 2160 "Zend/zend_ini_scanner.c"
yy184:
YYDEBUG(184, *YYCURSOR);
yyaccept = 3;
@@ -2180,11 +2182,11 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy185:
YYDEBUG(185, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 423 "Zend/zend_ini_scanner.l"
+#line 425 "Zend/zend_ini_scanner.l"
{ /* Get constant option value */
RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
}
-#line 2188 "Zend/zend_ini_scanner.c"
+#line 2190 "Zend/zend_ini_scanner.c"
yy186:
YYDEBUG(186, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2197,13 +2199,13 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy188:
YYDEBUG(188, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 348 "Zend/zend_ini_scanner.l"
+#line 350 "Zend/zend_ini_scanner.l"
{ /* End of section */
BEGIN(INITIAL);
SCNG(lineno)++;
return ']';
}
-#line 2207 "Zend/zend_ini_scanner.c"
+#line 2209 "Zend/zend_ini_scanner.c"
yy189:
YYDEBUG(189, *YYCURSOR);
++YYCURSOR;
@@ -2515,7 +2517,7 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
++YYCURSOR;
YYDEBUG(217, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 339 "Zend/zend_ini_scanner.l"
+#line 341 "Zend/zend_ini_scanner.l"
{ /* Raw string */
/* Eat leading and trailing single quotes */
if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') {
@@ -2524,18 +2526,18 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
}
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
-#line 2528 "Zend/zend_ini_scanner.c"
+#line 2530 "Zend/zend_ini_scanner.c"
yy218:
YYDEBUG(218, *YYCURSOR);
++YYCURSOR;
YYDEBUG(219, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 369 "Zend/zend_ini_scanner.l"
+#line 371 "Zend/zend_ini_scanner.l"
{ /* Variable start */
yy_push_state(ST_VARNAME TSRMLS_CC);
return TC_DOLLAR_CURLY;
}
-#line 2539 "Zend/zend_ini_scanner.c"
+#line 2541 "Zend/zend_ini_scanner.c"
yy220:
YYDEBUG(220, *YYCURSOR);
yyaccept = 0;
@@ -2714,12 +2716,12 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy226:
YYDEBUG(226, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 488 "Zend/zend_ini_scanner.l"
+#line 490 "Zend/zend_ini_scanner.l"
{ /* End of option value (if EOF is reached before EOL */
BEGIN(INITIAL);
return END_OF_LINE;
}
-#line 2723 "Zend/zend_ini_scanner.c"
+#line 2725 "Zend/zend_ini_scanner.c"
yy227:
YYDEBUG(227, *YYCURSOR);
yyaccept = 0;
@@ -2728,11 +2730,11 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy228:
YYDEBUG(228, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 445 "Zend/zend_ini_scanner.l"
+#line 447 "Zend/zend_ini_scanner.l"
{ /* Get everything else as option/offset value */
RETURN_TOKEN(TC_STRING, yytext, yyleng);
}
-#line 2736 "Zend/zend_ini_scanner.c"
+#line 2738 "Zend/zend_ini_scanner.c"
yy229:
YYDEBUG(229, *YYCURSOR);
yyaccept = 1;
@@ -2741,24 +2743,24 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy230:
YYDEBUG(230, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 468 "Zend/zend_ini_scanner.l"
+#line 470 "Zend/zend_ini_scanner.l"
{
RETURN_TOKEN(TC_WHITESPACE, yytext, yyleng);
}
-#line 2749 "Zend/zend_ini_scanner.c"
+#line 2751 "Zend/zend_ini_scanner.c"
yy231:
YYDEBUG(231, *YYCURSOR);
++YYCURSOR;
yy232:
YYDEBUG(232, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 417 "Zend/zend_ini_scanner.l"
+#line 419 "Zend/zend_ini_scanner.l"
{ /* End of option value */
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
}
-#line 2762 "Zend/zend_ini_scanner.c"
+#line 2764 "Zend/zend_ini_scanner.c"
yy233:
YYDEBUG(233, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2772,23 +2774,23 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy235:
YYDEBUG(235, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 435 "Zend/zend_ini_scanner.l"
+#line 437 "Zend/zend_ini_scanner.l"
{ /* Boolean operators */
return yytext[0];
}
-#line 2780 "Zend/zend_ini_scanner.c"
+#line 2782 "Zend/zend_ini_scanner.c"
yy236:
YYDEBUG(236, *YYCURSOR);
++YYCURSOR;
yy237:
YYDEBUG(237, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 453 "Zend/zend_ini_scanner.l"
+#line 455 "Zend/zend_ini_scanner.l"
{ /* Double quoted '"' string start */
yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC);
return '"';
}
-#line 2792 "Zend/zend_ini_scanner.c"
+#line 2794 "Zend/zend_ini_scanner.c"
yy238:
YYDEBUG(238, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2864,11 +2866,11 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy243:
YYDEBUG(243, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 427 "Zend/zend_ini_scanner.l"
+#line 429 "Zend/zend_ini_scanner.l"
{ /* Get number option value as string */
RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
}
-#line 2872 "Zend/zend_ini_scanner.c"
+#line 2874 "Zend/zend_ini_scanner.c"
yy244:
YYDEBUG(244, *YYCURSOR);
yyaccept = 2;
@@ -2879,13 +2881,13 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
++YYCURSOR;
YYDEBUG(246, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 439 "Zend/zend_ini_scanner.l"
+#line 441 "Zend/zend_ini_scanner.l"
{ /* Make = used in option value to trigger error */
yyless(0);
BEGIN(INITIAL);
return END_OF_LINE;
}
-#line 2889 "Zend/zend_ini_scanner.c"
+#line 2891 "Zend/zend_ini_scanner.c"
yy247:
YYDEBUG(247, *YYCURSOR);
yyaccept = 4;
@@ -2921,11 +2923,11 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy248:
YYDEBUG(248, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 423 "Zend/zend_ini_scanner.l"
+#line 425 "Zend/zend_ini_scanner.l"
{ /* Get constant option value */
RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
}
-#line 2929 "Zend/zend_ini_scanner.c"
+#line 2931 "Zend/zend_ini_scanner.c"
yy249:
YYDEBUG(249, *YYCURSOR);
yyaccept = 4;
@@ -3417,11 +3419,11 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy265:
YYDEBUG(265, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 383 "Zend/zend_ini_scanner.l"
+#line 385 "Zend/zend_ini_scanner.l"
{ /* TRUE value (when used outside option value/offset this causes parse error!) */
RETURN_TOKEN(BOOL_TRUE, "1", 1);
}
-#line 3425 "Zend/zend_ini_scanner.c"
+#line 3427 "Zend/zend_ini_scanner.c"
yy266:
YYDEBUG(266, *YYCURSOR);
++YYCURSOR;
@@ -3621,11 +3623,11 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy272:
YYDEBUG(272, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 387 "Zend/zend_ini_scanner.l"
+#line 389 "Zend/zend_ini_scanner.l"
{ /* FALSE value (when used outside option value/offset this causes parse error!)*/
RETURN_TOKEN(BOOL_FALSE, "", 0);
}
-#line 3629 "Zend/zend_ini_scanner.c"
+#line 3631 "Zend/zend_ini_scanner.c"
yy273:
YYDEBUG(273, *YYCURSOR);
++YYCURSOR;
@@ -4001,13 +4003,13 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy285:
YYDEBUG(285, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 482 "Zend/zend_ini_scanner.l"
+#line 484 "Zend/zend_ini_scanner.l"
{ /* Comment */
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
}
-#line 4011 "Zend/zend_ini_scanner.c"
+#line 4013 "Zend/zend_ini_scanner.c"
yy286:
YYDEBUG(286, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4219,7 +4221,7 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
++YYCURSOR;
YYDEBUG(298, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 339 "Zend/zend_ini_scanner.l"
+#line 341 "Zend/zend_ini_scanner.l"
{ /* Raw string */
/* Eat leading and trailing single quotes */
if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') {
@@ -4228,18 +4230,18 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
}
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
-#line 4232 "Zend/zend_ini_scanner.c"
+#line 4234 "Zend/zend_ini_scanner.c"
yy299:
YYDEBUG(299, *YYCURSOR);
++YYCURSOR;
YYDEBUG(300, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 369 "Zend/zend_ini_scanner.l"
+#line 371 "Zend/zend_ini_scanner.l"
{ /* Variable start */
yy_push_state(ST_VARNAME TSRMLS_CC);
return TC_DOLLAR_CURLY;
}
-#line 4243 "Zend/zend_ini_scanner.c"
+#line 4245 "Zend/zend_ini_scanner.c"
yy301:
YYDEBUG(301, *YYCURSOR);
++YYCURSOR;
@@ -4345,11 +4347,11 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
++YYCURSOR;
YYDEBUG(311, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 493 "Zend/zend_ini_scanner.l"
+#line 495 "Zend/zend_ini_scanner.l"
{
return 0;
}
-#line 4353 "Zend/zend_ini_scanner.c"
+#line 4355 "Zend/zend_ini_scanner.c"
yy312:
YYDEBUG(312, *YYCURSOR);
++YYCURSOR;
@@ -4358,22 +4360,22 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
yy313:
YYDEBUG(313, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 374 "Zend/zend_ini_scanner.l"
+#line 376 "Zend/zend_ini_scanner.l"
{ /* Variable name */
RETURN_TOKEN(TC_VARNAME, yytext, yyleng);
}
-#line 4366 "Zend/zend_ini_scanner.c"
+#line 4368 "Zend/zend_ini_scanner.c"
yy314:
YYDEBUG(314, *YYCURSOR);
++YYCURSOR;
YYDEBUG(315, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 378 "Zend/zend_ini_scanner.l"
+#line 380 "Zend/zend_ini_scanner.l"
{ /* Variable end */
yy_pop_state(TSRMLS_C);
return '}';
}
-#line 4377 "Zend/zend_ini_scanner.c"
+#line 4379 "Zend/zend_ini_scanner.c"
yy316:
YYDEBUG(316, *YYCURSOR);
++YYCURSOR;
@@ -4387,6 +4389,6 @@ int ini_lex(zval *ini_lval TSRMLS_DC)
goto yy313;
}
}
-#line 497 "Zend/zend_ini_scanner.l"
+#line 499 "Zend/zend_ini_scanner.l"
}
View
8 Zend/zend_ini_scanner.l
@@ -37,7 +37,9 @@
#include "zend_ini_scanner_defs.h"
#define YYCTYPE unsigned char
-#define YYFILL(n) { if (YYCURSOR >= YYLIMIT) return 0; }
+/* allow the scanner to read one null byte after the end of the string (from ZEND_MMAP_AHEAD)
+ * so that if will be able to terminate to match the current token (e.g. non-enclosed string) */
+#define YYFILL(n) { if (YYCURSOR > YYLIMIT) return 0; }
#define YYCURSOR SCNG(yy_cursor)
#define YYLIMIT SCNG(yy_limit)
#define YYMARKER SCNG(yy_marker)
@@ -58,8 +60,8 @@
/* perform sanity check. If this message is triggered you should
increase the ZEND_MMAP_AHEAD value in the zend_streams.h file */
/*!max:re2c */
-#if ZEND_MMAP_AHEAD < YYMAXFILL
-# error ZEND_MMAP_AHEAD should be greater than or equal to YYMAXFILL
+#if ZEND_MMAP_AHEAD < (YYMAXFILL + 1)
+# error ZEND_MMAP_AHEAD should be greater than YYMAXFILL
#endif
View
2 Zend/zend_ini_scanner_defs.h
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.6.dev on Thu Aug 7 13:22:08 2008 */
+/* Generated by re2c 0.13.5 on Sun Aug 17 22:48:22 2008 */
#line 3 "Zend/zend_ini_scanner_defs.h"
enum YYCONDTYPE {

0 comments on commit 1defd7a

Please sign in to comment.