aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorGravatar Maxime Dénès <mail@maximedenes.fr>2017-08-17 16:34:59 +0200
committerGravatar Maxime Dénès <mail@maximedenes.fr>2017-08-17 16:34:59 +0200
commit7451651a70be86ef8f510faabcba445766595187 (patch)
treee0511a0bb498049266faf5098dd1780992e96f5a /lib
parent88226ad302d4c128173644fc9d992ada67ba6d9c (diff)
parent6d5e0dd693e8e7322465323dc8eed4bea1ddce21 (diff)
Merge PR #490: A possible fix for #5391 (command line tools do not accept trailing / and \ on windows)
Diffstat (limited to 'lib')
-rw-r--r--lib/minisys.ml4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/minisys.ml b/lib/minisys.ml
index 1ed017e48..706f0430c 100644
--- a/lib/minisys.ml
+++ b/lib/minisys.ml
@@ -44,11 +44,13 @@ let ok_dirname f =
(* Check directory can be opened *)
let exists_dir dir =
+ (* See BZ#5391 on windows failing on a trailing (back)slash *)
let rec strip_trailing_slash dir =
let len = String.length dir in
if len > 0 && (dir.[len-1] = '/' || dir.[len-1] = '\\')
then strip_trailing_slash (String.sub dir 0 (len-1)) else dir in
- try Sys.is_directory (strip_trailing_slash dir) with Sys_error _ -> false
+ let dir = if Sys.os_type = "Win32" then strip_trailing_slash dir else dir in
+ try Sys.is_directory dir with Sys_error _ -> false
let apply_subdir f path name =
(* we avoid all files and subdirs starting by '.' (e.g. .svn) *)