Merge branch '1.2'
authorPetri Lehtinen <petri@digip.org>
Thu, 20 May 2010 15:47:30 +0000 (18:47 +0300)
committerPetri Lehtinen <petri@digip.org>
Thu, 20 May 2010 15:47:30 +0000 (18:47 +0300)
1  2 
doc/apiref.rst
src/dump.c
test/.gitignore
test/suites/api/Makefile.am

diff --cc doc/apiref.rst
Simple merge
diff --cc src/dump.c
@@@ -290,23 -289,26 +296,25 @@@ static int do_dump(const json_t *json, 
              iter = json_object_iter((json_t *)json);
  
              if(dump("{", 1, data))
-                 return -1;
-             if(!iter)
+                 goto object_error;
+             if(!iter) {
+                 object->visited = 0;
                  return dump("}", 1, data);
+             }
              if(dump_indent(flags, depth + 1, 0, dump, data))
-                 return -1;
+                 goto object_error;
  
 -            if(flags & JSON_SORT_KEYS)
 +            if(flags & JSON_SORT_KEYS || flags & JSON_PRESERVE_ORDER)
              {
 -                /* Sort keys */
 -
 -                const char **keys;
 +                const object_key_t **keys;
                  unsigned int size;
                  unsigned int i;
 +                int (*cmp_func)(const void *, const void *);
  
                  size = json_object_size(json);
 -                keys = malloc(size * sizeof(const char *));
 +                keys = malloc(size * sizeof(object_key_t *));
                  if(!keys)
-                     return -1;
+                     goto object_error;
  
                  i = 0;
                  while(iter)
diff --cc test/.gitignore
Simple merge
Simple merge