Deleted Added
full compact
546a547,550
> if (st == NULL) {
> ucl_set_err (parser->chunks, 0, "cannot allocate memory for an object", &parser->err);
> return NULL;
> }
557c561,562
< const char *start, const char *end, const char **pos, bool allow_double, bool number_bytes)
---
> const char *start, const char *end, const char **pos,
> bool allow_double, bool number_bytes, bool allow_time)
562c567
< is_date = false, valid_start = false, is_hex = false,
---
> is_time = false, valid_start = false, is_hex = false,
660c665,666
< if (endptr == NULL || ucl_lex_is_atom_end (*endptr) || *endptr == '\0') {
---
> if (endptr == NULL || ucl_lex_is_atom_end (*endptr) || *endptr == '\0' ||
> ucl_test_character (*endptr, UCL_CHARACTER_WHITESPACE_UNSAFE)) {
681c687
< is_date = true;
---
> is_time = true;
711c717
< else if (end - p >= 3) {
---
> else if (allow_time && end - p >= 3) {
720c726
< is_date = true;
---
> is_time = true;
740c746,747
< if (p == end - 1 || ucl_lex_is_atom_end (p[1])) {
---
> if (allow_time &&
> (p == end - 1 || ucl_lex_is_atom_end (p[1]))) {
746c753
< is_date = true;
---
> is_time = true;
758c765,766
< if (p == end - 1 || ucl_lex_is_atom_end (p[1])) {
---
> if (allow_time &&
> (p == end - 1 || ucl_lex_is_atom_end (p[1]))) {
763c771
< is_date = true;
---
> is_time = true;
776,777c784,785
< if (allow_double && (need_double || is_date)) {
< if (!is_date) {
---
> if (allow_double && (need_double || is_time)) {
> if (!is_time) {
806c814,815
< ret = ucl_maybe_parse_number (obj, chunk->pos, chunk->end, (const char **)&pos, true, false);
---
> ret = ucl_maybe_parse_number (obj, chunk->pos, chunk->end, (const char **)&pos,
> true, false, ((parser->flags & UCL_PARSER_NO_TIME) == 0));
1310a1320,1322
> if (obj == NULL) {
> return false;
> }
1318a1331,1333
> if (obj == NULL) {
> return false;
> }
1610a1626,1628
> if (obj == NULL) {
> return false;
> }
1676c1694,1698
< obj = ucl_add_parser_stack (parser->cur_obj, parser, false, parser->stack->level + 1);
---
> obj = ucl_add_parser_stack (parser->cur_obj, parser, false,
> parser->stack->level + 1);
> if (obj == NULL) {
> return false;
> }
1789a1812,1814
> if (new == NULL) {
> return NULL;
> }
1810a1836,1838
> if (macro == NULL || handler == NULL) {
> return;
> }
1811a1840,1842
> if (new == NULL) {
> return;
> }
1853a1885,1887
> if (new == NULL) {
> return;
> }
1875a1910,1913
> if (data == NULL || len == 0) {
> ucl_create_err (&parser->err, "invalid chunk added");
> return false;
> }
1877a1916,1919
> if (chunk == NULL) {
> ucl_create_err (&parser->err, "cannot allocate chunk structure");
> return false;
> }
1897a1940,1954
>
> bool
> ucl_parser_add_string (struct ucl_parser *parser, const char *data,
> size_t len)
> {
> if (data == NULL) {
> ucl_create_err (&parser->err, "invalid string added");
> return false;
> }
> if (len == 0) {
> len = strlen (data);
> }
>
> return ucl_parser_add_chunk (parser, (const unsigned char *)data, len);
> }