From 953b47468b50d39afd540ddc350e17554fea85c9 Mon Sep 17 00:00:00 2001 From: Emmanuel Rodriguez Date: Thu, 9 Jul 2009 22:03:27 +0200 Subject: [PATCH] get_selected_markers() returns the proper count when empty in scalar context --- bindings/perl/Champlain/xs/ChamplainSelectionLayer.xs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bindings/perl/Champlain/xs/ChamplainSelectionLayer.xs b/bindings/perl/Champlain/xs/ChamplainSelectionLayer.xs index 0f9a2ab..e36fb31 100644 --- a/bindings/perl/Champlain/xs/ChamplainSelectionLayer.xs +++ b/bindings/perl/Champlain/xs/ChamplainSelectionLayer.xs @@ -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; } -- 2.39.5