diff options
author | Patrik Nyblom <[email protected]> | 2010-12-01 17:34:49 +0100 |
---|---|---|
committer | Patrik Nyblom <[email protected]> | 2010-12-01 17:34:49 +0100 |
commit | 1ab2f46d91bce11bdc5b7ec65d3b3df46eadb105 (patch) | |
tree | 918b79cd7bbccc87a9d15ecbf96f26db17414802 /lib | |
parent | 30ad8cfadba47123920128023cb06af6e0922746 (diff) | |
download | otp-1ab2f46d91bce11bdc5b7ec65d3b3df46eadb105.tar.gz otp-1ab2f46d91bce11bdc5b7ec65d3b3df46eadb105.tar.bz2 otp-1ab2f46d91bce11bdc5b7ec65d3b3df46eadb105.zip |
Make filelib not crash on re codepoints beyond 255 in re when filename is raw
Diffstat (limited to 'lib')
-rw-r--r-- | lib/stdlib/src/filelib.erl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/stdlib/src/filelib.erl b/lib/stdlib/src/filelib.erl index eaaca750ab..04147d40d1 100644 --- a/lib/stdlib/src/filelib.erl +++ b/lib/stdlib/src/filelib.erl @@ -185,11 +185,14 @@ do_fold_files2([File|T], Dir, RegExp, OrigRE, Recursive, Fun, Acc0, Mod) -> FullName = filename:join(Dir, File), case do_is_regular(FullName, Mod) of true -> - case re:run(File, if is_binary(File) -> OrigRE; true -> RegExp end, - [{capture,none}]) of + case (catch re:run(File, if is_binary(File) -> OrigRE; + true -> RegExp end, + [{capture,none}])) of match -> Acc = Fun(FullName, Acc0), do_fold_files2(T, Dir, RegExp, OrigRE, Recursive, Fun, Acc, Mod); + {'EXIT',_} -> + do_fold_files2(T, Dir, RegExp, OrigRE, Recursive, Fun, Acc0, Mod); nomatch -> do_fold_files2(T, Dir, RegExp, OrigRE, Recursive, Fun, Acc0, Mod) end; |