summaryrefslogtreecommitdiffstats
path: root/perl_checker.src
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-09-30 18:49:41 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-09-30 18:49:41 +0000
commitaa1c154e46f6886584b9c16f894e0ff2dcabdbfa (patch)
treefe40081b58aed2c29e3d8d8782a1a4c340db4a89 /perl_checker.src
parent6e76f2858c0442acbff8ada3e09d3ad70e538ab9 (diff)
downloadperl_checker-aa1c154e46f6886584b9c16f894e0ff2dcabdbfa.tar
perl_checker-aa1c154e46f6886584b9c16f894e0ff2dcabdbfa.tar.gz
perl_checker-aa1c154e46f6886584b9c16f894e0ff2dcabdbfa.tar.bz2
perl_checker-aa1c154e46f6886584b9c16f894e0ff2dcabdbfa.tar.xz
perl_checker-aa1c154e46f6886584b9c16f894e0ff2dcabdbfa.zip
handle same files with different names (cuz of symbolic links)
Diffstat (limited to 'perl_checker.src')
-rw-r--r--perl_checker.src/common.ml10
1 files changed, 7 insertions, 3 deletions
diff --git a/perl_checker.src/common.ml b/perl_checker.src/common.ml
index 4a7f950..6d5c79c 100644
--- a/perl_checker.src/common.ml
+++ b/perl_checker.src/common.ml
@@ -829,9 +829,13 @@ let expand_symlinks file =
| _ -> internal_error (Printf.sprintf "expand_symlinks: %s is relative\n" file)
let file_to_absolute_file file =
- if file.[0] = '/' then file else
- let cwd = Unix.getcwd() in
- if file = "." then cwd else expand_symlinks (cwd ^ "/" ^ file)
+ let abs_file =
+ if file.[0] = '/' then file else
+ let cwd = Unix.getcwd() in
+ if file = "." then cwd else cwd ^ "/" ^ file
+ in
+ expand_symlinks abs_file
+
let mtime f = int_of_float ((Unix.stat f).Unix.st_mtime)