[libchamplain] get_selected_markers() returns the proper count when empty in scalar context



commit 953b47468b50d39afd540ddc350e17554fea85c9
Author: Emmanuel Rodriguez <emmanuel rodriguez gmail com>
Date:   Thu Jul 9 22:03:27 2009 +0200

    get_selected_markers() returns the proper count when empty in scalar context

 .../perl/Champlain/xs/ChamplainSelectionLayer.xs   |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
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;
 		}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]