diff options
author | James Ahlborn <jtahlborn@yahoo.com> | 2019-01-29 02:00:59 +0000 |
---|---|---|
committer | James Ahlborn <jtahlborn@yahoo.com> | 2019-01-29 02:00:59 +0000 |
commit | cb9ed9bd0bee33de31c4c3323dc46cac53be2745 (patch) | |
tree | a93cb7365f469d34670e367539b916b4fe88310a | |
parent | 743ea3342892c814a253105a33525ef5ae7e4d69 (diff) | |
download | jackcess-cb9ed9bd0bee33de31c4c3323dc46cac53be2745.tar.gz jackcess-cb9ed9bd0bee33de31c4c3323dc46cac53be2745.zip |
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
3 files changed, 6 insertions, 1 deletions
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 @@ <author email="javajedi@users.sf.net">Tim McCune</author> </properties> <body> + <release version="2.2.3" date="TBD"> + <action dev="jahlborn" type="fix"> + Fix parsing of escaped double quotes in expressions. + </action> + </release> <release version="2.2.2" date="2019-01-05"> <action dev="jahlborn" type="fix" system="SourceForge2" issue="151"> 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)"); |