Mercurial > hg > monetdb-java
diff src/main/java/nl/cwi/monetdb/mcl/parser/StartOfHeaderParser.java @ 117:a030c3e53cf5
Skip over column delimiter, and don't accept just "-" as a valid number.
author | Sjoerd Mullender <sjoerd@acm.org> |
---|---|
date | Fri, 17 Feb 2017 09:47:48 +0100 (2017-02-17) |
parents | 04c535b05c52 |
children | fdf4c888d5b7 |
line wrap: on
line diff
--- a/src/main/java/nl/cwi/monetdb/mcl/parser/StartOfHeaderParser.java +++ b/src/main/java/nl/cwi/monetdb/mcl/parser/StartOfHeaderParser.java @@ -104,10 +104,14 @@ public class StartOfHeaderParser { char chr = soh.get(); // note: don't use Character.isDigit() here, because // we only want ISO-LATIN-1 digits + if(chr == '-') { + positive = false; + if (!soh.hasRemaining()) + throw new MCLParseException("unexpected end of string", soh.position() - 1); + chr = soh.get(); + } if (chr >= '0' && chr <= '9') { tmp = (int)chr - (int)'0'; - } else if(chr == '-') { - positive = false; } else { throw new MCLParseException("expected a digit", soh.position() - 1); }