From: Emmanuel Rodriguez Date: Thu, 9 Jul 2009 20:03:27 +0000 (+0200) Subject: get_selected_markers() returns the proper count when empty in scalar context X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=953b47468b50d39afd540ddc350e17554fea85c9;p=libchamplain get_selected_markers() returns the proper count when empty in scalar context --- 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; }