diff --git a/.gitignore b/.gitignore index 60c4a0b..88a0b0d 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,4 @@ /libs/ /doc/doxyfile /dist/ -/include/json/version.h +#/include/json/version.h diff --git a/include/json/version.h b/include/json/version.h index 58fca8a..baf5daa 100644 --- a/include/json/version.h +++ b/include/json/version.h @@ -4,10 +4,10 @@ #ifndef JSON_VERSION_H_INCLUDED # define JSON_VERSION_H_INCLUDED -# define JSONCPP_VERSION_STRING "1.1.0" +# define JSONCPP_VERSION_STRING "1.1.1" # define JSONCPP_VERSION_MAJOR 1 # define JSONCPP_VERSION_MINOR 1 -# define JSONCPP_VERSION_PATCH 0 +# define JSONCPP_VERSION_PATCH 1 # define JSONCPP_VERSION_QUALIFIER # define JSONCPP_VERSION_HEXA ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | (JSONCPP_VERSION_PATCH << 8)) diff --git a/src/lib_json/json_reader.cpp b/src/lib_json/json_reader.cpp index c5111f8..dfae3fb 100644 --- a/src/lib_json/json_reader.cpp +++ b/src/lib_json/json_reader.cpp @@ -381,11 +381,24 @@ bool Reader::readCppStyleComment() { } void Reader::readNumber() { - while (current_ != end_) { - if (!(*current_ >= '0' && *current_ <= '9') && - !in(*current_, '.', 'e', 'E', '+', '-')) - break; - ++current_; + const char *p = current_; + char c = '0'; // stopgap for already consumed character + // integral part + while (c >= '0' && c <= '9') + c = (current_ = p) < end_ ? *p++ : 0; + // fractional part + if (c == '.') { + c = (current_ = p) < end_ ? *p++ : 0; + while (c >= '0' && c <= '9') + c = (current_ = p) < end_ ? *p++ : 0; + } + // exponential part + if (c == 'e' || c == 'E') { + c = (current_ = p) < end_ ? *p++ : 0; + if (c == '+' || c == '-') + c = (current_ = p) < end_ ? *p++ : 0; + while (c >= '0' && c <= '9') + c = (current_ = p) < end_ ? *p++ : 0; } } diff --git a/version b/version index 6314dac..cd075f2 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.1.0 \ No newline at end of file +1.1.1 \ No newline at end of file