nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e492d8a
)
core: simplify_path supports Windows style path
author
Alexis Laferrière
<alexis.laf@xymus.net>
Fri, 10 Feb 2017 06:32:31 +0000
(22:32 -0800)
committer
Alexis Laferrière
<alexis.laf@xymus.net>
Sat, 11 Feb 2017 00:36:56 +0000
(19:36 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
lib/core/file.nit
patch
|
blob
|
history
diff --git
a/lib/core/file.nit
b/lib/core/file.nit
index
c78f6d4
..
baa3403
100644
(file)
--- 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 `././`