mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-01-31 14:39:52 +01:00
Merge branch 'fix-fail31'
This commit is contained in:
commit
73e127892e
2
.gitignore
vendored
2
.gitignore
vendored
@ -10,4 +10,4 @@
|
||||
/libs/
|
||||
/doc/doxyfile
|
||||
/dist/
|
||||
/include/json/version.h
|
||||
#/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))
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user