提交 60222856 authored 作者: noelgrandin's avatar noelgrandin

Fix to org.h2.util.ScriptReader when handling unclosed block comments.

上级 b2f81257
...@@ -73,6 +73,7 @@ Change Log ...@@ -73,6 +73,7 @@ Change Log
in order to make Websphere happy. in order to make Websphere happy.
</li><li>Make Server#openBrowser respect the $BROWSER environment variable. Add "chromium" to the list of browsers tried. </li><li>Make Server#openBrowser respect the $BROWSER environment variable. Add "chromium" to the list of browsers tried.
Patch from Felix Kaiser. Patch from Felix Kaiser.
</li><li>Fix to org.h2.util.ScriptReader when handling unclosed block comments.
</li></ul> </li></ul>
<h2>Version 1.3.173 (2013-07-28)</h2> <h2>Version 1.3.173 (2013-07-28)</h2>
......
...@@ -140,7 +140,7 @@ public class ScriptReader { ...@@ -140,7 +140,7 @@ public class ScriptReader {
c = read(); c = read();
if (c == '*') { if (c == '*') {
// block comment // block comment
startRemark(false); startRemark(true);
while (true) { while (true) {
c = read(); c = read();
if (c < 0) { if (c < 0) {
......
...@@ -186,6 +186,12 @@ public class TestScriptReader extends TestBase { ...@@ -186,6 +186,12 @@ public class TestScriptReader extends TestBase {
assertEquals(null, source.readStatement()); assertEquals(null, source.readStatement());
source.close(); source.close();
// check handling of unclosed block comments
s = "/*xxx";
source = new ScriptReader(new StringReader(s));
assertEquals("/*xxx", source.readStatement());
assertTrue(source.isBlockRemark());
source.close();
} }
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论