5 Commits
v1.0 ... v1.0.2

Author SHA1 Message Date
Petri Lehtinen
827a01937f jansson 1.0.2 2009-09-08 16:48:26 +03:00
Petri Lehtinen
0f62dac627 load: Handle EOF correctly
In stream_get(), EOF never got it to stream->buffer and because of
this, stream_unget() failed on some situations. This patch makes
stream_get() handle EOF just like any other byte.

As a "side effect", lex_scan_string() now needs to unget the EOF, or
otherwise it ends up in error message on premature end of input.
2009-09-08 16:41:07 +03:00
Petri Lehtinen
ab2d93b724 Add CHANGES 2009-09-06 12:45:47 +03:00
Petri Lehtinen
e4be4a4a28 jansson 1.0.1 2009-09-04 20:58:55 +03:00
Petri Lehtinen
78eda92908 jansson.h: Fix typo
json_is_true was spelled jsin_is_true. Quite fatal.
2009-09-04 15:21:00 +03:00
6 changed files with 17 additions and 9 deletions

11
CHANGES Normal file
View File

@@ -0,0 +1,11 @@
Version 1.0.2, released 2009-09-08
* Handle EOF correctly in decoder
Version 1.0.1, released 2009-09-04
* Fixed broken json_is_boolean()
Version 1.0, released 2009-08-25
* Initial release

View File

@@ -1,5 +1,5 @@
AC_PREREQ([2.63])
AC_INIT([jansson], [1.0], [petri@digip.org])
AC_INIT([jansson], [1.0.2], [petri@digip.org])
AM_INIT_AUTOMAKE([1.10 foreign])

View File

@@ -52,7 +52,7 @@ copyright = u'2009, Petri Lehtinen'
# The short X.Y version.
version = '1.0'
# The full version, including alpha/beta/rc tags.
release = '1.0'
release = '1.0.2'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.

View File

@@ -13,6 +13,6 @@ libjansson_la_SOURCES = \
utf.h \
util.h \
value.c
libjansson_la_LDFLAGS = -version-info 0:0:0
libjansson_la_LDFLAGS = -version-info 0:2:0
AM_CFLAGS = -Wall -Wextra -Werror -std=c99

View File

@@ -38,7 +38,7 @@ typedef struct {
#define json_is_number(json) (json_is_integer(json) || json_is_real(json))
#define json_is_true(json) (json && json_typeof(json) == JSON_TRUE)
#define json_is_false(json) (json && json_typeof(json) == JSON_FALSE)
#define json_is_boolean(json) (jsin_is_true(json) || json_is_false(json))
#define json_is_boolean(json) (json_is_true(json) || json_is_false(json))
#define json_is_null(json) (json && json_typeof(json) == JSON_NULL)
/* construction, destruction, reference counting */

View File

@@ -134,10 +134,7 @@ static char stream_get(stream_t *stream, json_error_t *error)
c = stream->buffer[0];
if(c == EOF && stream->eof(stream->data))
return EOF;
if(c < 0)
if(c < 0 && c != EOF)
{
/* multi-byte UTF-8 sequence */
int i, count;
@@ -257,11 +254,11 @@ static void lex_scan_string(lex_t *lex, json_error_t *error)
lex->value.string = NULL;
lex->token = TOKEN_INVALID;
/* skip the " */
c = lex_get_save(lex, error);
while(c != '"') {
if(c == EOF) {
lex_unget_unsave(lex, c);
if(lex_eof(lex))
error_set(error, lex, "premature end of input");
goto out;