| Author |
Message |
|
| Guest |
Posted: Sun Jul 18, 2010 6:58 am |
|
|
|
Guest
|
Hello,
"Normalize" feature of filename:join breaks Windows UNC paths:
filename:join("//host/share", "file") returns "/host/share/file" on Windows instead "//host/share/file".
Patch below fixes the problem.
Regards,
Evgeny.
------------------- patch --------------------------------
diff --git a/lib/stdlib/src/filename.erl b/lib/stdlib/src/filename.erl
index 01c06e4..8da54ef 100644
--- a/lib/stdlib/src/filename.erl
+++ b/lib/stdlib/src/filename.erl
@@ -316,6 +316,10 @@ join(Name1, Name2) when is_atom(Name2) ->
%% It is the responsibility of the caller to ensure that RelativeName
%% is relative.
+join1([$/, $/ | Rest], RelativeName, [], win32) -> [$/, $/ | join1(Rest, RelativeName, [], win32)];
+join1([$/, $\\ | Rest], RelativeName, [], win32) -> [$/, $/ | join1(Rest, RelativeName, [], win32)];
+join1([$\\, $/ | Rest], RelativeName, [], win32) -> [$/, $/ | join1(Rest, RelativeName, [], win32)];
+join1([$\\, $\\ | Rest], RelativeName, [], win32) -> [$/, $/ | join1(Rest, RelativeName, [], win32)];
join1([UcLetter, $:|Rest], RelativeName, [], win32)
when is_integer(UcLetter), UcLetter >= $A, UcLetter =< $Z ->
join1(Rest, RelativeName, [$:, UcLetter+$a-$A], win32);
------------------- patch --------------------------------
________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Sun Jul 18, 2010 6:58 am |
|
|
|
Guest
|
Hello,
"Normalize" feature of filename:join breaks Windows UNC paths:
filename:join("//host/share", "file") returns "/host/share/file" on Windows instead "//host/share/file".
Patch below fixes the problem.
Regards,
Evgeny.
------------------- patch --------------------------------
diff --git a/lib/stdlib/src/filename.erl b/lib/stdlib/src/filename.erl
index 01c06e4..8da54ef 100644
--- a/lib/stdlib/src/filename.erl
+++ b/lib/stdlib/src/filename.erl
@@ -316,6 +316,10 @@ join(Name1, Name2) when is_atom(Name2) ->
%% It is the responsibility of the caller to ensure that RelativeName
%% is relative.
+join1([$/, $/ | Rest], RelativeName, [], win32) -> [$/, $/ | join1(Rest, RelativeName, [], win32)];
+join1([$/, $\\ | Rest], RelativeName, [], win32) -> [$/, $/ | join1(Rest, RelativeName, [], win32)];
+join1([$\\, $/ | Rest], RelativeName, [], win32) -> [$/, $/ | join1(Rest, RelativeName, [], win32)];
+join1([$\\, $\\ | Rest], RelativeName, [], win32) -> [$/, $/ | join1(Rest, RelativeName, [], win32)];
join1([UcLetter, $:|Rest], RelativeName, [], win32)
when is_integer(UcLetter), UcLetter >= $A, UcLetter =< $Z ->
join1(Rest, RelativeName, [$:, UcLetter+$a-$A], win32);
------------------- patch --------------------------------
________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org
Post received from mailinglist |
|
|
| Back to top |
|
|
|
All times are GMT
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
|
|