aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tools/src/xref_utils.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2017-06-27 12:46:01 +0200
committerSiri Hansen <[email protected]>2017-07-06 17:53:22 +0200
commit796a110362b780abadcb114940e6fadd14105ff4 (patch)
tree81042e3b14ffcbc721ea0433f1f8bcd8a5c1f96a /lib/tools/src/xref_utils.erl
parentbba078a97b70137fd0ab7d0f883886406cc6d82c (diff)
downloadotp-796a110362b780abadcb114940e6fadd14105ff4.tar.gz
otp-796a110362b780abadcb114940e6fadd14105ff4.tar.bz2
otp-796a110362b780abadcb114940e6fadd14105ff4.zip
tools: Do not use deprecated functions in string(3)
Diffstat (limited to 'lib/tools/src/xref_utils.erl')
-rw-r--r--lib/tools/src/xref_utils.erl11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/tools/src/xref_utils.erl b/lib/tools/src/xref_utils.erl
index b0c168e018..f12ab0f41c 100644
--- a/lib/tools/src/xref_utils.erl
+++ b/lib/tools/src/xref_utils.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -557,12 +557,9 @@ subdir(Dir, SubDir, true) ->
%% Avoid "App-01.01" - the zeroes will be lost.
filename2appl(File) ->
- Pos = string:rstr(File, "-"),
- true = Pos > 1,
- V = string:sub_string(File, Pos+1),
- true = string:len(V) > 0,
- VsnT = string:tokens(V, "."),
- ApplName = string:sub_string(File, 1, Pos-1),
+ [ApplName, V] = string:split(File, "-", trailing),
+ true = string:length(V) > 0,
+ VsnT = string:lexemes(V, "."),
Vsn = [list_to_integer(Vsn) || Vsn <- VsnT],
{list_to_atom(ApplName),Vsn}.