Enlightenment CVS committal

Author  : amedeiros
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_fileselector.c 


Log Message:
* Applied David Sharp's patch which corrects the extra trailling slash;
* File selector would show ".." on the root dir;

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_fileselector.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- ewl_fileselector.c  17 Feb 2005 19:14:55 -0000      1.6
+++ ewl_fileselector.c  22 Feb 2005 10:58:24 -0000      1.7
@@ -440,6 +440,8 @@
                        memcpy(name + strlen(path2),
                               lecture->d_name, strlen(lecture->d_name));
                        name[len - 1] = '\0';
+                       if(!strcmp(lecture->d_name,"..")&&!strcmp(path,"/"))
+                               continue;
                        if (stat(name, &buf) == 0) {
                                if (S_ISDIR(buf.st_mode) && dlist) {
                                        d = 
ewl_fileselector_data_new(lecture->d_name,
@@ -500,11 +502,13 @@
        fs = data;
        path = ewl_widget_data_get(w, "FILESELECTOR_DIR");
 
-       if (!strcmp(path, ".."))
+       if (!strcmp(path, "..")) {
                new_path = ewl_fileselector_path_up_get(fs->path);
-       else
+               path = strdup(new_path);
+       } else {
                new_path = ewl_fileselector_str_append(fs->path, path);
-       path = ewl_fileselector_str_append(new_path, "/");
+               path = ewl_fileselector_str_append(new_path, "/");
+       }
        FREE(new_path);
 
        ewl_fileselector_path_setup(fs, path);
@@ -723,4 +727,3 @@
        v = ewl_widget_data_get(w, "FILESELECTOR_DIR");
        IF_FREE(v);
 }
-




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to