From: erickson Date: Mon, 10 Oct 2005 23:04:39 +0000 (+0000) Subject: fixed logic bug in the xpath finder X-Git-Tag: osrf_rel_2_0_1~1324 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a293804a1cc1b344230d07161eca6a12f497ee3e;p=OpenSRF.git fixed logic bug in the xpath finder git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@549 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/objson/object.c b/src/objson/object.c index ee3dbff..f427936 100644 --- a/src/objson/object.c +++ b/src/objson/object.c @@ -702,7 +702,17 @@ jsonObject* _jsonObjectFindPathRecurse(const jsonObject* obj, char* root, char* for( i = 0; i < arr->size; i++ ) { jsonObject* a = jsonObjectGetIndex(arr, i); jsonObject* thing = jsonObjectFindPath(a , path + strlen(root) + 1); - if(thing) jsonObjectPush(newarr, thing); + + if(thing) { //jsonObjectPush(newarr, thing); + if(thing->type == JSON_ARRAY) { + int i; + for( i = 0; i != thing->size; i++ ) + jsonObjectPush(newarr, jsonObjectGetIndex(thing,i)); + + } else { + jsonObjectPush(newarr, thing); + } + } } }