aboutsummaryrefslogtreecommitdiffstats
path: root/lib/reltool/src/reltool_mod_win.erl
diff options
context:
space:
mode:
authorHåkan Mattsson <[email protected]>2010-05-19 17:18:56 +0200
committerHåkan Mattsson <[email protected]>2010-05-19 17:18:56 +0200
commit05e023894c704431c0eabf1db3506b839a5a79c0 (patch)
treee2f551bc7c362b46201c4b1c0fcb7dd115a3687a /lib/reltool/src/reltool_mod_win.erl
parent5fe8d47a60c89f1235f9fc727e650ada491246a3 (diff)
downloadotp-05e023894c704431c0eabf1db3506b839a5a79c0.tar.gz
otp-05e023894c704431c0eabf1db3506b839a5a79c0.tar.bz2
otp-05e023894c704431c0eabf1db3506b839a5a79c0.zip
Improve lookup of erl files
Instead of looking up erl files that almost matched exact match is now required. For example a file named "junk_food.erl" will not longer match "food.erl".
Diffstat (limited to 'lib/reltool/src/reltool_mod_win.erl')
-rw-r--r--lib/reltool/src/reltool_mod_win.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/reltool/src/reltool_mod_win.erl b/lib/reltool/src/reltool_mod_win.erl
index f68c61fd6f..281d2c8ad4 100644
--- a/lib/reltool/src/reltool_mod_win.erl
+++ b/lib/reltool/src/reltool_mod_win.erl
@@ -334,9 +334,9 @@ find_regular_bin(App, Mod) ->
ActiveDir = App#app.active_dir,
SrcDir = filename:join([ActiveDir, "src"]),
ModStr = atom_to_list(Mod#mod.name),
- Base = ModStr ++ ".erl",
- Find = fun(F, _Acc) -> file:read_file(F) end,
- case filelib:fold_files(SrcDir, Base, true, Find, {error, enoent}) of
+ Base = "^" ++ ModStr ++ "\\.erl$",
+ Find = fun(F, _Acc) -> throw(file:read_file(F)) end,
+ case catch filelib:fold_files(SrcDir, Base, true, Find, {error, enoent}) of
{ok, Bin} ->
Bin;
{error, enoent} ->