From 46d99ecfdc8b5d1f6d35c415d020eca5cd6130e1 Mon Sep 17 00:00:00 2001
From: Dan Gudmundsson <dgud@erlang.org>
Date: Tue, 19 Feb 2013 16:14:49 +0100
Subject: Quote windows paths with spaces

---
 lib/sasl/src/erlsrv.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'lib/sasl/src')

diff --git a/lib/sasl/src/erlsrv.erl b/lib/sasl/src/erlsrv.erl
index 086dc7c651..67f6941479 100644
--- a/lib/sasl/src/erlsrv.erl
+++ b/lib/sasl/src/erlsrv.erl
@@ -30,7 +30,7 @@
 
 erlsrv(EVer) ->
     Root = code:root_dir(),
-    filename:join([Root, "erts-" ++ EVer, "bin", "erlsrv.exe"]).
+    "\"" ++ filename:join([Root, "erts-" ++ EVer, "bin", "erlsrv.exe"]) ++ "\"".
 
 current_version() ->
     hd(string:tokens(erlang:system_info(version),"_ ")).
-- 
cgit v1.2.3


From ee23d4b549618044d4a4f800db839483b359cb9f Mon Sep 17 00:00:00 2001
From: Dan Gudmundsson <dgud@erlang.org>
Date: Thu, 18 Apr 2013 14:55:47 +0200
Subject: erts: Windows, convert erlsrv to use widestring

---
 lib/sasl/src/erlsrv.erl | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

(limited to 'lib/sasl/src')

diff --git a/lib/sasl/src/erlsrv.erl b/lib/sasl/src/erlsrv.erl
index 67f6941479..711c1c6f1c 100644
--- a/lib/sasl/src/erlsrv.erl
+++ b/lib/sasl/src/erlsrv.erl
@@ -30,7 +30,7 @@
 
 erlsrv(EVer) ->
     Root = code:root_dir(),
-    "\"" ++ filename:join([Root, "erts-" ++ EVer, "bin", "erlsrv.exe"]) ++ "\"".
+    filename:join([Root, "erts-" ++ EVer, "bin", "erlsrv.exe"]).
 
 current_version() ->
     hd(string:tokens(erlang:system_info(version),"_ ")).
@@ -71,11 +71,14 @@ write_all_data(Port,[]) ->
     Port ! {self(), {command, io_lib:nl()}},
     ok;
 write_all_data(Port,[H|T]) ->
-    Port ! {self(), {command, H ++ io_lib:nl()}},
+    Port ! {self(), {command, unicode:characters_to_binary([H,io_lib:nl()])}},
     write_all_data(Port,T).
 
 read_all_data(Port) ->
-	lists:reverse(read_all_data(Port,[],[])).
+    Data0 = lists:reverse(read_all_data(Port,[],[])),
+    %% Convert from utf8 to a list of chars
+    [unicode:characters_to_list(list_to_binary(Data)) || Data <- Data0].
+
 read_all_data(Port,Line,Lines) ->
     receive
 	{Port, {data, {noeol,Data}}} ->
@@ -178,7 +181,7 @@ get_service(EVer, ServiceName) ->
 				[]
 			end
 		end,
-	    %%% First split by Env:
+            %%% First split by Env:
 	    {Before, After} = split_by_env(Data),
 	    FirstPass = lists:flatten(lists:map(F,Before)),
 	    %%% If the arguments are there, split them to
-- 
cgit v1.2.3