Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_text.c 


Log Message:
- fixup some issues with the positioning in ewl_text.
  - this fixes eap_edit so it dosen't segv on a new eap being created

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_text.c,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -3 -r1.106 -r1.107
--- ewl_text.c  11 Jun 2006 12:49:10 -0000      1.106
+++ ewl_text.c  30 Jun 2006 00:00:20 -0000      1.107
@@ -2978,17 +2978,19 @@
 ewl_text_utf_char_position_next(const char *text, unsigned int pos)
 {
        const unsigned char *t;
+       int len;
 
-       t = text;
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR_RET("text", text, 0);
 
-       if (!text) {
+       if (text[0] == '\0')
                DRETURN_INT(0, DLEVEL_STABLE);
-       }
-       
-       do {
+
+       t = text;
+       len = strlen(text);
+
+       while ((t[pos] >= 0x80) && (t[pos] <= 0xbf) && (pos < len));
                pos++;
-       }
-       while (t[pos] >= 0x80 && t[pos] <= 0xbf);
 
        DRETURN_INT(pos, DLEVEL_STABLE);
 }
@@ -2997,16 +2999,19 @@
 ewl_text_utf_char_position_prev(const char *text, unsigned int pos)
 {
        const unsigned char *t;
+       int len;
 
-       t = text;
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR_RET("text", text, 0);
 
-       if (!text)
+       if (text[0] == '\0')
                DRETURN_INT(0, DLEVEL_STABLE);
-       
-       do {
+
+       t = text;
+       len = strlen(text);
+
+       while ((t[pos] >= 0x80) && (t[pos] <= 0xbf) && (pos < len));
                pos--;
-       }
-       while (t[pos] >= 0x80 && t[pos] <= 0xbf && pos > 0);
 
        DRETURN_INT(pos, DLEVEL_STABLE);
 }



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
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to