diff options
-rw-r--r-- | lib/jinterface/test/jitu.erl | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/lib/jinterface/test/jitu.erl b/lib/jinterface/test/jitu.erl index 571a2dc9c7..0de074a9c9 100644 --- a/lib/jinterface/test/jitu.erl +++ b/lib/jinterface/test/jitu.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2012. All Rights Reserved. +%% Copyright Ericsson AB 2004-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -84,24 +84,26 @@ to_string([]) -> []. % filename:join(Dir, File)). classpath(Dir) -> - PS = + {PS,Quote,EscSpace} = case os:type() of - {win32, _} -> ";"; - _ -> ":" + {win32, _} -> {";","\"",""}; + _ -> {":","","\\"} end, es(Dir++PS++ filename:join([code:lib_dir(jinterface),"priv","OtpErlang.jar"])++PS++ case os:getenv("CLASSPATH") of false -> ""; Classpath -> Classpath - end). - -es(L) -> - lists:flatmap(fun($ ) -> - "\\ "; - (C) -> - [C] - end,lists:flatten(L)). + end, + Quote, + EscSpace). + +es(L,Quote,EscSpace) -> + Quote++lists:flatmap(fun($ ) -> + EscSpace++" "; + (C) -> + [C] + end,lists:flatten(L)) ++ Quote. cmd(Cmd) -> PortOpts = [{line,80},eof,exit_status,stderr_to_stdout], |