[Libreoffice-commits] core.git: connectivity/source

Lionel Elie Mamane (via logerrit) logerrit at kemper.freedesktop.org
Fri May 8 09:04:14 UTC 2020


 connectivity/source/parse/sqlflex.l |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit b6ab865a371f5c46f96d931721f03afde82b7ec1
Author:     Lionel Elie Mamane <lionel at mamane.lu>
AuthorDate: Fri May 8 07:51:53 2020 +0200
Commit:     Lionel Elie Mamane <lionel at mamane.lu>
CommitDate: Fri May 8 11:03:37 2020 +0200

    tdf#122461 SQL identifiers (names) can contain newlines
    
    Change-Id: Ic58e6b65e146b2e0d9cb656aa5fa06cfe955d11d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93690
    Tested-by: Jenkins
    Reviewed-by: Lionel Elie Mamane <lionel at mamane.lu>

diff --git a/connectivity/source/parse/sqlflex.l b/connectivity/source/parse/sqlflex.l
index 62cdc0abb865..34a4067ea21c 100644
--- a/connectivity/source/parse/sqlflex.l
+++ b/connectivity/source/parse/sqlflex.l
@@ -526,6 +526,8 @@ sal_Int32 gatherString(int delim, sal_Int32 nTyp)
     int ch;
     OStringBuffer sBuffer(256);
 
+    assert(nTyp == 0 || nTyp == 1 || nTyp == 2);
+
     while (!checkeof(ch = yyinput()))
     {
         if (ch == delim)
@@ -554,7 +556,7 @@ sal_Int32 gatherString(int delim, sal_Int32 nTyp)
             }
 
         }
-        else if (nTyp != 1 && (ch == '\r' || ch == '\n') )
+        else if (nTyp == 2 && (ch == '\r' || ch == '\n') )
             break;
         else
         {


More information about the Libreoffice-commits mailing list