From f4b7e74a62170912df757f36242ba8dfd3051ecc Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 9 Jan 2004 14:35:05 +0000 Subject: now allow ../../../xxx instead of ../../xxx (to allow move/move.pm to be relative) --- perl_checker.src/info.ml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'perl_checker.src/info.ml') diff --git a/perl_checker.src/info.ml b/perl_checker.src/info.ml index d872ca7..ca14f9e 100644 --- a/perl_checker.src/info.ml +++ b/perl_checker.src/info.ml @@ -29,8 +29,11 @@ let file_to_absolute_file file = let absolute_file_to_file = let s1 = Filename.dirname cwd in if String.length s1 < 4 then (fun x -> x) else - let s2 = Filename.dirname s1 in - let short_cwd = if String.length s2 < 4 then s1 else s2 in + let short_cwd = + let s2 = Filename.dirname s1 in + if String.length s2 < 4 then s1 else + let s3 = Filename.dirname s2 in (* allow up to ../../../xxx *) + if String.length s3 < 4 then s2 else s3 in memoize (fun abs_file -> if str_begins_with abs_file (short_cwd ^ "/") then let rec to_file rel cwd = -- cgit v1.2.1