summaryrefslogtreecommitdiffstats
path: root/perl_checker.src/common.ml
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-12-19 20:42:32 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-12-19 20:42:32 +0000
commit91a49a49d0b6a7713e644a79412fd5307d7cb335 (patch)
tree1b6565ed1b795510b9f29660840eb08ec83b45bc /perl_checker.src/common.ml
parent2375b0413acc1f3e6659fc110c13bcc061cd320d (diff)
downloadperl_checker-91a49a49d0b6a7713e644a79412fd5307d7cb335.tar
perl_checker-91a49a49d0b6a7713e644a79412fd5307d7cb335.tar.gz
perl_checker-91a49a49d0b6a7713e644a79412fd5307d7cb335.tar.bz2
perl_checker-91a49a49d0b6a7713e644a79412fd5307d7cb335.tar.xz
perl_checker-91a49a49d0b6a7713e644a79412fd5307d7cb335.zip
- perl_checker: many new features including
- checking methods being available - checking unused functions - saving parsed file in .perl_checker.cache - new instruction "Basedir .." in .perl_checker (useful for gi/perl-install/standalone/.perl_checker)
Diffstat (limited to 'perl_checker.src/common.ml')
-rw-r--r--perl_checker.src/common.ml10
1 files changed, 10 insertions, 0 deletions
diff --git a/perl_checker.src/common.ml b/perl_checker.src/common.ml
index 44e63fd..c9991b7 100644
--- a/perl_checker.src/common.ml
+++ b/perl_checker.src/common.ml
@@ -748,6 +748,16 @@ let rec fold_lines f init chan =
with End_of_file -> init
let readlines chan = List.rev (fold_lines (fun l e -> e::l) [] chan)
+let rec updir dir nb =
+ if nb = 0 then dir else
+ match dir with
+ | "." -> String.concat "/" (times ".." nb)
+ | _ ->
+ if Filename.basename dir = ".." then
+ dir ^ "/" ^ String.concat "/" (times ".." nb)
+ else
+ updir (Filename.dirname dir) (nb-1)
+
let split_at c s =
let rec split_at_ accu i =
try