Enlightenment CVS committal

Author  : ningerso
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_dnd.c 


Log Message:
Fix DND type encoding and matching.

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_dnd.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- ewl_dnd.c   6 Sep 2006 15:37:37 -0000       1.20
+++ ewl_dnd.c   7 Sep 2006 18:54:37 -0000       1.21
@@ -154,8 +154,12 @@
        DCHECK_TYPE_RET("w", w, EWL_WIDGET_TYPE, FALSE);
 
        types = ecore_hash_get(ewl_dnd_provides_hash, w);
-
-       DRETURN_INT(ewl_dnd_types_encoded_contains(types, type), DLEVEL_STABLE);
+       if (types) {
+               DRETURN_INT(ewl_dnd_types_encoded_contains(types, type), 
DLEVEL_STABLE);
+       }
+       else {
+               DRETURN_INT(FALSE, DLEVEL_STABLE);
+       }
 }
 
 
@@ -215,9 +219,14 @@
        DCHECK_PARAM_PTR_RET("w", w, FALSE);
        DCHECK_TYPE_RET("w", w, EWL_WIDGET_TYPE, FALSE);
 
-       types = ecore_hash_get(ewl_dnd_provides_hash, w);
+       types = ecore_hash_get(ewl_dnd_accepts_hash, w);
 
-       DRETURN_INT(ewl_dnd_types_encoded_contains(types, type), DLEVEL_STABLE);
+       if (types) {
+               DRETURN_INT(ewl_dnd_types_encoded_contains(types, type), 
DLEVEL_STABLE);
+       }
+       else {
+               DRETURN_INT(FALSE, DLEVEL_STABLE);
+       }
 }
 
 /**
@@ -453,7 +462,7 @@
 static char *
 ewl_dnd_types_encode(const char **types)
 {
-       char *tmptype;
+       char *type, *tmptype;
        int count, i = 0;
        int len = 0;
 
@@ -467,15 +476,15 @@
                i++;
        }
 
-       tmptype = NEW(char, len + 1);
+       type = tmptype = NEW(char, len + 1);
        count = i;
        for (i = 0; i < count; i++) {
-               tmptype = strcpy(tmptype, types[i]);
+               tmptype = stpcpy(tmptype, types[i]);
                tmptype++;
        }
        *tmptype = '\0';
 
-       DRETURN_PTR(tmptype, DLEVEL_STABLE);
+       DRETURN_PTR(type, DLEVEL_STABLE);
 }
 
 static int



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to