Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src


Modified Files:
        ewl_fileselector.c 


Log Message:
- fix segv if you double click on the .. button while looking at the /
  directory.
- the one issue with this is, if you use hits open while viewing the /
  directory the returned value is //

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_fileselector.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -3 -r1.36 -r1.37
--- ewl_fileselector.c  13 May 2004 06:03:00 -0000      1.36
+++ ewl_fileselector.c  15 Jul 2004 03:23:12 -0000      1.37
@@ -320,14 +320,19 @@
                ptr++;
                if (!strcmp (ptr, "..")) {
                        ptr--;
-                       *ptr = '\0';
-                       ptr = strrchr(path, '/');
-                       ptr++;
-                       *ptr = '\0';
 
-                       if (strcmp(path, "/")) {
-                               ptr--;
+                       if (ptr != path) {
                                *ptr = '\0';
+                               ptr = strrchr(path, '/');
+                               ptr++;
+                               *ptr = '\0';
+
+                               if (strcmp(path, "/")) {
+                                       ptr--;
+                                       *ptr = '\0';
+                               }
+                       } else {
+                               *++ptr = '\0';
                        }
                }
                snprintf (dir, PATH_MAX, "%s", path);




-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to