From 3b27b306eae1f91d4ac07f1178a6415f2b51b3c7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Thu, 9 Feb 2017 22:32:31 -0800 Subject: [PATCH] core: simplify_path supports Windows style path MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- lib/core/file.nit | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/core/file.nit b/lib/core/file.nit index c78f6d4..baa3403 100644 --- a/lib/core/file.nit +++ b/lib/core/file.nit @@ -1057,7 +1057,8 @@ redef class String # ~~~ fun simplify_path: String do - var a = self.split_with("/") + var path_sep = if is_windows then "\\" else "/" + var a = self.split_with(path_sep) var a2 = new Array[String] for x in a do if x == "." and not a2.is_empty then continue # skip `././` -- 1.7.9.5