File tree Expand file tree Collapse file tree 3 files changed +5
-2
lines changed
Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -884,7 +884,8 @@ defmodule File do
884884 """
885885 def cwd ( ) do
886886 case F . get_cwd do
887- { :ok , cwd } -> { :ok , to_string ( cwd ) }
887+ { :ok , base } when is_binary ( base ) -> { :ok , base }
888+ { :ok , base } -> { :ok , to_string ( base ) }
888889 { :error , _ } = error -> error
889890 end
890891 end
Original file line number Diff line number Diff line change @@ -243,6 +243,7 @@ defmodule Path do
243243 """
244244 def relative_to_cwd ( path ) do
245245 case :file . get_cwd do
246+ { :ok , base } when is_binary ( base ) -> relative_to ( path , to_char_list ( base ) )
246247 { :ok , base } -> relative_to ( path , base )
247248 _ -> path
248249 end
Original file line number Diff line number Diff line change @@ -93,7 +93,8 @@ defmodule System do
9393 """
9494 def cwd do
9595 case :file . get_cwd do
96- { :ok , list } -> String . from_char_list! ( list )
96+ { :ok , base } when is_binary ( base ) -> base
97+ { :ok , base } -> String . from_char_list! ( base )
9798 _ -> nil
9899 end
99100 end
You can’t perform that action at this time.
0 commit comments