]> granicus.if.org Git - php/commitdiff
Fixed bug #36046 (parse_ini_file() miscounts lines in multi-line values).
authorIlia Alshanetsky <iliaa@php.net>
Tue, 17 Jan 2006 19:56:25 +0000 (19:56 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 17 Jan 2006 19:56:25 +0000 (19:56 +0000)
Zend/zend_ini_scanner.l

index dd9e621b3087e456cf2956910c7b8745eef81e9a..2495c603607747c669f41802842930a6bdaa3cd1 100644 (file)
@@ -139,8 +139,18 @@ NEWLINE ("\r"|"\n"|"\r\n")
 
 
 <INITIAL>["][^"]*["] {
+       char *p = yytext;
+
        /* ENCAPSULATED TC_STRING */
 
+       while ((p = strpbrk(p, "\r\n"))) {
+               if (*p == '\r' && *(p + 1) == '\n') {
+                       p++;
+               }
+               SCNG(lineno)++;
+               p++;
+       }
+
        /* eat trailing " */
        yytext[yyleng-1]=0;