r345 - trunk

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Mon Sep 24 22:24:10 EDT 2007


Author: icculus
Date: 2007-09-24 22:24:10 -0400 (Mon, 24 Sep 2007)
New Revision: 345

Modified:
   trunk/platform_unix.c
Log:
MojoPlatform_filesize() should only be used on regular files and not follow
 symlinks.


Modified: trunk/platform_unix.c
===================================================================
--- trunk/platform_unix.c	2007-09-23 06:33:02 UTC (rev 344)
+++ trunk/platform_unix.c	2007-09-25 02:24:10 UTC (rev 345)
@@ -707,7 +707,7 @@
 {
     int retval = -1;
     struct stat statbuf;
-    if (stat(fname, &statbuf) != -1)
+    if ( (lstat(fname, &statbuf) != -1) && (S_ISREG(statbuf.st_mode)) )
         retval = (int64) statbuf.st_size;
     return retval;
 } // MojoPlatform_filesize




More information about the mojosetup-commits mailing list