aboutsummaryrefslogtreecommitdiffstats
path: root/lib/reltool
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2017-08-22 14:59:30 +0200
committerSiri Hansen <[email protected]>2017-09-15 17:07:51 +0200
commitedfb0fb05dc8f10b603ef79c49b4f6e8c01ec5b3 (patch)
tree96b3187d1ec926f32fb6d67b8155ee5fc156b128 /lib/reltool
parenta3624ab24535458b13abb7e314ed7dfbe3da09ba (diff)
downloadotp-edfb0fb05dc8f10b603ef79c49b4f6e8c01ec5b3.tar.gz
otp-edfb0fb05dc8f10b603ef79c49b4f6e8c01ec5b3.tar.bz2
otp-edfb0fb05dc8f10b603ef79c49b4f6e8c01ec5b3.zip
system (test): Do not use deprecated functions in string(3)
Diffstat (limited to 'lib/reltool')
-rw-r--r--lib/reltool/test/reltool_server_SUITE.erl19
1 files changed, 7 insertions, 12 deletions
diff --git a/lib/reltool/test/reltool_server_SUITE.erl b/lib/reltool/test/reltool_server_SUITE.erl
index e8dfea94da..e97b23efe2 100644
--- a/lib/reltool/test/reltool_server_SUITE.erl
+++ b/lib/reltool/test/reltool_server_SUITE.erl
@@ -2549,7 +2549,7 @@ undefined_regexp(_Config) ->
%% Library functions
erl_libs() ->
- string:tokens(os:getenv("ERL_LIBS", ""), ":;").
+ string:lexemes(os:getenv("ERL_LIBS", ""), ":;").
datadir(Config) ->
%% Removes the trailing slash...
@@ -2559,7 +2559,7 @@ latest(App) ->
AppStr = atom_to_list(App),
AppDirs = filelib:wildcard(filename:join(code:lib_dir(),AppStr++"-*")),
[LatestAppDir|_] = lists:reverse(AppDirs),
- [_,Vsn] = string:tokens(filename:basename(LatestAppDir),"-"),
+ [_,Vsn] = string:lexemes(filename:basename(LatestAppDir),"-"),
Vsn.
rm_missing_app(Apps) ->
@@ -2635,16 +2635,11 @@ os_cmd(Cmd) when is_list(Cmd) ->
Return->
%% Find the position of the status code wich is last in the string
%% prepended with #
- case string:rchr(Return, $#) of
-
- %% This happens only if the sh command pipe is somehow interrupted
- 0->
- {98, Return};
-
- Position->
- Result = string:left(Return,Position - 1),
- Status = string:substr(Return,Position + 1, length(Return) - Position - 1),
- {list_to_integer(Status), Result}
+ case string:split(Return, "$#", trailing) of
+ [_] -> %% This happens only if the sh command pipe is somehow interrupted
+ {98, Return};
+ [Result, Status0] ->
+ {list_to_integer(string:trim(Status0)), Result}
end
end.