From 0efdc769b260bb832e7f59d8bfb80def65f554ff Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Wed, 12 Nov 2014 22:22:22 +0000 Subject: Handle non numeric returns for traverse_tag_find callback fix a warning spot by Angelo Naselli --- NEWS | 1 + URPM.xs | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 38a3cfa..5817727 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,5 @@ - add a missing PUTBACK in traverse_tag_find() +- handle non numeric returns for traverse_tag_find callback (warning fix) Version 5.02 - 26 October 2014 diff --git a/URPM.xs b/URPM.xs index 10d9c2c..aac4b43 100644 --- a/URPM.xs +++ b/URPM.xs @@ -2447,11 +2447,14 @@ Db_traverse_tag_find(db,tag,name,callback) int count = _run_cb_while_traversing(callback, header, 0); SPAGAIN; - if (count == 1 && POPi) { - found = 1; - break; + if (count == 1) { + SV* ret = POPs; + found = SvTRUE(ret); } PUTBACK; + if (found) { + break; + } } rpmtsSetVSFlags(db->ts, ovsflags); (void)rpmdbFreeIterator(mi); -- cgit v1.2.1