From cb9ed9bd0bee33de31c4c3323dc46cac53be2745 Mon Sep 17 00:00:00 2001 From: James Ahlborn Date: Tue, 29 Jan 2019 02:00:59 +0000 Subject: Fix parsing of escaped double quotes in expressions git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@1267 f203690c-595d-4dc9-a70b-905162fa7fd2 --- src/changes/changes.xml | 5 +++++ .../healthmarketscience/jackcess/impl/expr/ExpressionTokenizer.java | 1 - .../healthmarketscience/jackcess/impl/expr/DefaultFunctionsTest.java | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index a01a4e8..caa9288 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -4,6 +4,11 @@ Tim McCune + + + Fix parsing of escaped double quotes in expressions. + + Fix length in units calculation for Access 97 text fields. diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/expr/ExpressionTokenizer.java b/src/main/java/com/healthmarketscience/jackcess/impl/expr/ExpressionTokenizer.java index cc0fca4..8705490 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/expr/ExpressionTokenizer.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/expr/ExpressionTokenizer.java @@ -269,7 +269,6 @@ class ExpressionTokenizer char c = buf.next(); if(c == endChar) { if(allowDoubledEscape && (buf.peekNext() == endChar)) { - sb.append(endChar); buf.next(); } else { complete = true; diff --git a/src/test/java/com/healthmarketscience/jackcess/impl/expr/DefaultFunctionsTest.java b/src/test/java/com/healthmarketscience/jackcess/impl/expr/DefaultFunctionsTest.java index 132b788..84cab7c 100644 --- a/src/test/java/com/healthmarketscience/jackcess/impl/expr/DefaultFunctionsTest.java +++ b/src/test/java/com/healthmarketscience/jackcess/impl/expr/DefaultFunctionsTest.java @@ -144,6 +144,7 @@ public class DefaultFunctionsTest extends TestCase assertEval("FOOO", "=UCase(\"fOoO\")"); assertEval("fooo", "=LCase(\"fOoO\")"); + assertEval(" FOO \" BAR ", "=UCase(\" foo \"\" bar \")"); assertEval("bl", "=Left(\"blah\", 2)"); assertEval("", "=Left(\"blah\", 0)"); -- cgit v1.2.3