lib: handle ../.. in the simplify_path method
authorJean Privat <jean@pryen.org>
Fri, 17 Feb 2012 21:05:55 +0000 (16:05 -0500)
committerJean Privat <jean@pryen.org>
Fri, 17 Feb 2012 21:05:55 +0000 (16:05 -0500)
Signed-off-by: Jean Privat <jean@pryen.org>

lib/standard/file.nit

index 00fbb32..b7e3a15 100644 (file)
@@ -249,7 +249,7 @@ redef class String
                for x in a do
                        if x == "." then continue
                        if x == "" and not a2.is_empty then continue
-                       if x == ".." and not a2.is_empty then
+                       if x == ".." and not a2.is_empty and a2.last != ".." then
                                a2.pop
                                continue
                        end