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
commitfccde77987a942d09a64058b22eb3844fe468335 (patch)
tree527b61a94b45a306be0c34a31c4e4edf564e79ac /perl_checker.src/common.ml
parent1e9b027b5bb760a1b15d76a7b4574052853930e0 (diff)
downloadperl-MDK-Common-fccde77987a942d09a64058b22eb3844fe468335.tar
perl-MDK-Common-fccde77987a942d09a64058b22eb3844fe468335.tar.gz
perl-MDK-Common-fccde77987a942d09a64058b22eb3844fe468335.tar.bz2
perl-MDK-Common-fccde77987a942d09a64058b22eb3844fe468335.tar.xz
perl-MDK-Common-fccde77987a942d09a64058b22eb3844fe468335.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