From 2d5b39132f4a7dd2541f95d795682089eb1c5f5e Mon Sep 17 00:00:00 2001 From: Pierre Boutillier Date: Thu, 9 Oct 2014 12:59:41 +0200 Subject: Fixup leading ./ path cleaning --- lib/cUnix.ml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/cUnix.ml b/lib/cUnix.ml index a4d6903c0..55d888ef2 100644 --- a/lib/cUnix.ml +++ b/lib/cUnix.ml @@ -34,10 +34,12 @@ let rec cut_after_dirsep p pos = else String.sub p pos (String.length p - pos) -(** remove all initial "./" in a path *) +(** remove all initial "./" in a path unless the path is exactly "./" *) let rec remove_path_dot p = if CString.is_sub curdir p 0 then - remove_path_dot (cut_after_dirsep p curdir_len) + if String.length p = curdir_len + then Filename.current_dir_name + else remove_path_dot (cut_after_dirsep p curdir_len) else p -- cgit v1.2.3