Skip to content

Commit 73e1278

Browse files
committed
Merge branch 'fix-fail31'
2 parents e0bfb45 + 4997dfb commit 73e1278

File tree

4 files changed

+22
-9
lines changed

4 files changed

+22
-9
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
/libs/
1111
/doc/doxyfile
1212
/dist/
13-
/include/json/version.h
13+
#/include/json/version.h

include/json/version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
#ifndef JSON_VERSION_H_INCLUDED
55
# define JSON_VERSION_H_INCLUDED
66

7-
# define JSONCPP_VERSION_STRING "1.1.0"
7+
# define JSONCPP_VERSION_STRING "1.1.1"
88
# define JSONCPP_VERSION_MAJOR 1
99
# define JSONCPP_VERSION_MINOR 1
10-
# define JSONCPP_VERSION_PATCH 0
10+
# define JSONCPP_VERSION_PATCH 1
1111
# define JSONCPP_VERSION_QUALIFIER
1212
# define JSONCPP_VERSION_HEXA ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | (JSONCPP_VERSION_PATCH << 8))
1313

src/lib_json/json_reader.cpp

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -381,11 +381,24 @@ bool Reader::readCppStyleComment() {
381381
}
382382

383383
void Reader::readNumber() {
384-
while (current_ != end_) {
385-
if (!(*current_ >= '0' && *current_ <= '9') &&
386-
!in(*current_, '.', 'e', 'E', '+', '-'))
387-
break;
388-
++current_;
384+
const char *p = current_;
385+
char c = '0'; // stopgap for already consumed character
386+
// integral part
387+
while (c >= '0' && c <= '9')
388+
c = (current_ = p) < end_ ? *p++ : 0;
389+
// fractional part
390+
if (c == '.') {
391+
c = (current_ = p) < end_ ? *p++ : 0;
392+
while (c >= '0' && c <= '9')
393+
c = (current_ = p) < end_ ? *p++ : 0;
394+
}
395+
// exponential part
396+
if (c == 'e' || c == 'E') {
397+
c = (current_ = p) < end_ ? *p++ : 0;
398+
if (c == '+' || c == '-')
399+
c = (current_ = p) < end_ ? *p++ : 0;
400+
while (c >= '0' && c <= '9')
401+
c = (current_ = p) < end_ ? *p++ : 0;
389402
}
390403
}
391404

version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.0
1+
1.1.1

0 commit comments

Comments
 (0)