Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_fileman_file.c e_fileman_smart.c 


Log Message:


FIX a fm segv - put a note as to why :)

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_fileman_file.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- e_fileman_file.c    23 Oct 2005 23:21:47 -0000      1.5
+++ e_fileman_file.c    24 Oct 2005 01:17:01 -0000      1.6
@@ -51,7 +51,13 @@
    struct stat st;
 
    if (stat(filename, &st) == -1) return NULL;
-
+   /* FIXME: stat above will fail if the file is a BROKEN SYMLINK - maybe we
+    * should not fail, but do an lstat here and see if it is a symlink (or
+    * just a race condition where the file was deleted as we scan), and
+    * if so mark it as a broken synlink. we should do an lstat ANYWAY
+    * so we know if a file is a symlink or not regardless what it points
+    * to.
+    */
    file = E_OBJECT_ALLOC(E_Fm_File, E_FM_FILE_TYPE, _e_fm_file_free);
    if (!file) return NULL;
    file->path = strdup(filename);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_fileman_smart.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -3 -r1.56 -r1.57
--- e_fileman_smart.c   23 Oct 2005 23:21:47 -0000      1.56
+++ e_fileman_smart.c   24 Oct 2005 01:17:01 -0000      1.57
@@ -1391,6 +1391,7 @@
    while ((dir_entry = readdir(dir)) != NULL)
     {
        E_Fm_Icon *icon;
+       
        if ((!strcmp(dir_entry->d_name, ".") || (!strcmp (dir_entry->d_name, 
"..")))) continue;
        if ((dir_entry->d_name[0] == '.') && (!(type & E_FM_FILE_TYPE_HIDDEN))) 
continue;
 
@@ -1398,11 +1399,18 @@
        if (!icon) continue;
        snprintf(path, sizeof(path), "%s/%s", sd->dir, dir_entry->d_name);
        icon->file = e_fm_file_new(path);
-       icon->icon_object = e_fm_icon_add(sd->evas);
-       icon->sd = sd;
-       e_fm_icon_file_set(icon->icon_object, icon->file);
-       evas_object_resize(icon->icon_object, sd->icon_info.w, sd->icon_info.h);
-       files = evas_list_append(files, icon);
+       if (!icon->file)
+        {
+           E_FREE(icon);
+        }
+       else
+        {
+           icon->icon_object = e_fm_icon_add(sd->evas);
+           icon->sd = sd;
+           e_fm_icon_file_set(icon->icon_object, icon->file);
+           evas_object_resize(icon->icon_object, sd->icon_info.w, 
sd->icon_info.h);
+           files = evas_list_append(files, icon);
+        }
     }
    closedir(dir);
 




-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to