File tree Expand file tree Collapse file tree 3 files changed +4
-3
lines changed
Expand file tree Collapse file tree 3 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -176,7 +176,7 @@ defmodule Exception do
176176 file = to_binary ( file )
177177
178178 if cwd do
179- file = :binary . replace ( file , cwd <> "/" , "" )
179+ file = Path . relative_to ( file , cwd )
180180 end
181181
182182 if line && line != 0 do
Original file line number Diff line number Diff line change @@ -120,8 +120,8 @@ defmodule Path do
120120 relative_to ( t1 , t2 , original )
121121 end
122122
123- defp relative_to ( t1 , [ ] , _original ) do
124- FN . join ( t1 )
123+ defp relative_to ( [ _ | _ ] = l1 , [ ] , _original ) do
124+ FN . join ( l1 )
125125 end
126126
127127 defp relative_to ( _ , _ , original ) do
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ defmodule PathTest do
5757 assert Path . relative_to ( "/usr/local/foo" , "/usr/local" ) == "foo"
5858 assert Path . relative_to ( "/usr/local/foo" , "/" ) == "usr/local/foo"
5959 assert Path . relative_to ( "/usr/local/foo" , "/etc" ) == "/usr/local/foo"
60+ assert Path . relative_to ( "/usr/local/foo" , "/usr/local/foo" ) == "/usr/local/foo"
6061
6162 assert Path . relative_to ( "usr/local/foo" , "usr/local" ) == "foo"
6263 assert Path . relative_to ( "usr/local/foo" , "etc" ) == "usr/local/foo"
You can’t perform that action at this time.
0 commit comments