We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 362df17 commit dacb30aCopy full SHA for dacb30a
lib/elixir/lib/path.ex
@@ -548,6 +548,10 @@ defmodule Path do
548
549
defp normalize(path), do: normalize(split(path), [])
550
551
+ defp normalize([".."|t], ["/"|_] = acc) do
552
+ normalize t, acc
553
+ end
554
+
555
defp normalize([".."|t], [_|acc]) do
556
normalize t, acc
557
end
lib/elixir/test/elixir/path_test.exs
@@ -111,6 +111,8 @@ defmodule PathTest do
111
strip_drive_letter_if_windows) == "/bar"
112
113
assert Path.expand("bar/../bar", "foo") == Path.expand("foo/bar")
114
115
+ assert (Path.expand("/..") |> strip_drive_letter_if_windows) == "/"
116
117
118
test :relative_to do
0 commit comments