Enlightenment CVS committal

Author  : gilbertt
Project : misc
Module  : feh

Dir     : misc/feh/src


Modified Files:
        filelist.c 


Log Message:
safety feature - if you do feh -df * when you mean feh -dF * (or similar),
avoid overwriting the first image with a filelist.

===================================================================
RCS file: /cvsroot/enlightenment/misc/feh/src/filelist.c,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -3 -r1.75 -r1.76
--- filelist.c  4 Jan 2004 00:14:13 -0000       1.75
+++ filelist.c  13 Aug 2004 10:14:01 -0000      1.76
@@ -516,12 +516,24 @@
    FILE *fp;
    gib_list *list = NULL;
    char s[1024], s1[1024];
+   Imlib_Image im1;
 
    D_ENTER(4);
 
    if (!filename)
       D_RETURN(4, NULL);
 
+   /* try and load the given filelist as an image, cowardly refuse to
+    * overwrite an image with a filelist. (requested by user who did feh -df *
+    * when he meant feh -dF *, as it overwrote the first image with the
+    * filelist).
+    */
+   if (feh_load_image_char(&im1, filename)) {
+      weprintf("The file you specified as a filelist to read - %s - appears to be an 
image. Ignoring it (this is a common mistake).\n", filename);
+      opt.filelistfile = NULL;
+      D_RETURN(4, NULL);
+   }
+   
    errno = 0;
    if ((fp = fopen(filename, "r")) == NULL)
    {




-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to