From 4f27cf57090532cad35a5006565184cdd8f3a85c Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 10 Oct 2005 23:04:39 +0000 Subject: [PATCH] fixed logic bug in the xpath finder git-svn-id: svn://svn.open-ils.org/ILS/trunk@1907 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- OpenSRF/src/objson/object.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/OpenSRF/src/objson/object.c b/OpenSRF/src/objson/object.c index ee3dbff86a..f4279366b4 100644 --- a/OpenSRF/src/objson/object.c +++ b/OpenSRF/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); + } + } } } -- 2.43.2