aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2011-07-01 10:31:44 +0200
committerSiri Hansen <[email protected]>2011-07-01 10:31:44 +0200
commit1baf7d6bb353e1c934f363c470e872b0c0c45b41 (patch)
tree3d5c96ff383d9961f63941d77b0b1e7c461330e6 /lib
parent7092c4a41ac0d38ae457c2dc768aa542337d8b8c (diff)
parent7c2e7a481ed4dd2a1369ac87a00799a7efd7add7 (diff)
downloadotp-1baf7d6bb353e1c934f363c470e872b0c0c45b41.tar.gz
otp-1baf7d6bb353e1c934f363c470e872b0c0c45b41.tar.bz2
otp-1baf7d6bb353e1c934f363c470e872b0c0c45b41.zip
Merge branch 'siri/sasl/compiler-warnings/OTP-9295' into dev
* siri/sasl/compiler-warnings/OTP-9295: Remove compiler warning for using deprecated module rexexp
Diffstat (limited to 'lib')
-rw-r--r--lib/sasl/src/systools_lib.erl33
1 files changed, 19 insertions, 14 deletions
diff --git a/lib/sasl/src/systools_lib.erl b/lib/sasl/src/systools_lib.erl
index b652c109fe..f951647b79 100644
--- a/lib/sasl/src/systools_lib.erl
+++ b/lib/sasl/src/systools_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2011. 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
@@ -176,21 +176,26 @@ add_dirs(RegName, Dirs, Root) ->
regexp_match(RegName, D0, Root) ->
case file:list_dir(D0) of
{ok, Files} when length(Files) > 0 ->
- FR = fun(F) ->
- case regexp:match(F, RegName) of
- {match,1,N} when N == length(F) ->
- DirF = join(D0, F, Root),
- case dir_p(DirF) of
- true ->
- {true, DirF};
+ case re:compile(RegName) of
+ {ok, MP} ->
+ FR = fun(F) ->
+ case re:run(F, MP) of
+ {match,[{0,N}]} when N == length(F) ->
+ DirF = join(D0, F, Root),
+ case dir_p(DirF) of
+ true ->
+ {true, DirF};
+ _ ->
+ false
+ end;
_ ->
false
- end;
- _ ->
- false
- end
- end,
- {true,lists:zf(FR, Files)};
+ end
+ end,
+ {true,lists:zf(FR, Files)};
+ _ ->
+ false
+ end;
_ ->
false
end.