瀏覽代碼

* Do not allow fileage for directories (15873)

git-svn-id: trunk@17221 -
michael 14 年之前
父節點
當前提交
9747f7f0cd
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      rtl/unix/sysutils.pp

+ 2 - 2
rtl/unix/sysutils.pp

@@ -524,9 +524,9 @@ Function FileAge (Const FileName : String): Longint;
 Var Info : Stat;
 
 begin
-  If  fpstat (pointer(FileName),Info)<0 then
+  If  (fpstat (pointer(FileName),Info)<0) or fpS_ISDIR(info.st_mode) then
     exit(-1)
-  else
+  else if 
     Result:=UnixToWinAge(info.st_mtime);
 end;
 {$endif}