aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sasl/src/systools_lib.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2013-02-22 09:53:16 +0100
committerSiri Hansen <[email protected]>2013-02-22 09:53:16 +0100
commitd1a7bed5b81aa619e09d951adbd947f680f76de6 (patch)
treed4d68cd55eef6d41654142734e69a86af3b8220c /lib/sasl/src/systools_lib.erl
parentf5c2c7299926bc024f296cf79f037576c260f0c9 (diff)
parentf354375898420aad6b14dce5703d415807f7218f (diff)
downloadotp-d1a7bed5b81aa619e09d951adbd947f680f76de6.tar.gz
otp-d1a7bed5b81aa619e09d951adbd947f680f76de6.tar.bz2
otp-d1a7bed5b81aa619e09d951adbd947f680f76de6.zip
Merge branch 'siri/sasl/unicode/OTP-10782'
* siri/sasl/unicode/OTP-10782: [sasl] Add unicode test for systools:make_script [sasl] Adapt release handling mechanisms to unicode
Diffstat (limited to 'lib/sasl/src/systools_lib.erl')
-rw-r--r--lib/sasl/src/systools_lib.erl15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/sasl/src/systools_lib.erl b/lib/sasl/src/systools_lib.erl
index 1b6ea125d9..6618baa2aa 100644
--- a/lib/sasl/src/systools_lib.erl
+++ b/lib/sasl/src/systools_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-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
@@ -42,7 +42,11 @@ file_term2binary(FileIn, FileOut) ->
%%______________________________________________________________________
%% read_term(File) -> {ok, Term} | Error
-
+%%
+%% This is really an own implementation of file:consult/1, except it
+%% returns one term and not a list of terms. Keeping the function
+%% instead of using file:consult - for backwards compatibility with
+%% error reasons.
read_term(File) ->
case file:open(File, [read]) of
{ok, Stream} ->
@@ -54,6 +58,7 @@ read_term(File) ->
end.
read_term_from_stream(Stream, File) ->
+ _ = epp:set_encoding(Stream),
R = io:request(Stream, {get_until,'',erl_scan,tokens,[1]}),
case R of
{ok,Toks,_EndLine} ->
@@ -176,11 +181,11 @@ add_dirs(RegName, Dirs, Root) ->
regexp_match(RegName, D0, Root) ->
case file:list_dir(D0) of
{ok, Files} when length(Files) > 0 ->
- case re:compile(RegName) of
+ case re:compile(RegName,[unicode]) of
{ok, MP} ->
FR = fun(F) ->
- case re:run(F, MP) of
- {match,[{0,N}]} when N == length(F) ->
+ case re:run(F, MP, [{capture,first,list}]) of
+ {match,[F]} -> % All of F matches
DirF = join(D0, F, Root),
case dir_p(DirF) of
true ->