]> err.no Git - libchamplain/commitdiff
get_selected_markers() returns the proper count when empty in scalar context
authorEmmanuel Rodriguez <emmanuel.rodriguez@gmail.com>
Thu, 9 Jul 2009 20:03:27 +0000 (22:03 +0200)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Tue, 28 Jul 2009 21:25:23 +0000 (17:25 -0400)
bindings/perl/Champlain/xs/ChamplainSelectionLayer.xs

index 0f9a2abbc7bf42ef0d4df7ce2c9a67ffc2bfbffe..e36fb313f9dfe1c94e5ed77e0eb9929fe290b418 100644 (file)
@@ -22,6 +22,10 @@ champlain_selection_layer_get_selected_markers (ChamplainSelectionLayer *layer)
                item = champlain_selection_layer_get_selected_markers(layer);
 
                if (!item) {
+                       if (GIMME == G_SCALAR) {
+                               XPUSHs(sv_2mortal(newSViv(0)));
+                               return;
+                       }
                        XSRETURN_EMPTY;
                }