changeset 3125:e91bd0560a71

Updated #267: Updated #send_data to pass through empty strings instead of passing nil
author unexist
date Mon, 14 Nov 2011 20:44:52 +0100
parents 963637b89e3b
children 74578423ead6
files src/subtle/ruby.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/subtle/ruby.c	Mon Nov 14 20:04:48 2011 +0100
+++ b/src/subtle/ruby.c	Mon Nov 14 20:44:52 2011 +0100
@@ -1444,7 +1444,7 @@
             Atom prop = subEwmhGet(SUB_EWMH_SUBTLE_DATA);
             VALUE meth = rb_intern("__data"), str = Qnil;
 
-            /* Get data */
+            /* Fetch data or create empty string */
             if((list = subSharedPropertyGetStrings(subtle->dpy, ROOT,
                 prop, &nlist)))
               {
@@ -1453,9 +1453,11 @@
 
                 XFreeStringList(list);
               }
+            else str = rb_str_new2("");
 
             subSharedPropertyDelete(subtle->dpy, ROOT, prop);
 
+            /* Finally call method */
             rb_funcall(rargs[1], meth,
               MINMAX(rb_obj_method_arity(rargs[1], meth), 1, 2),
               rargs[1], str);