From 8a2837fb4d8f7cf64497a3a03db8438a213d9a15 Mon Sep 17 00:00:00 2001 From: Enrico Fucile Date: Tue, 28 Jul 2015 16:11:55 +0100 Subject: [PATCH] fixed ECC-140 --- src/grib_query.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/grib_query.c b/src/grib_query.c index c3a9a1279..0ea277abe 100644 --- a/src/grib_query.c +++ b/src/grib_query.c @@ -272,13 +272,14 @@ static void search_accessors_list_by_condition(grib_accessors_list* al,const cha if (start==NULL && condition_true(al->accessor,condition)) start=al; if (start && !condition_true(al->accessor,condition)) end=al; } - al=al->next; - if (start && end) { + if (start!=NULL && ( end!=NULL || al->next==NULL) ) { + if (end==NULL) end=al; search_from_accessors_list(start,end,name,result); al=end; start=NULL; end=NULL; } + al=al->next; } }