Refactor search_for_file() util function.

It was getting too bloated and allocated memory in ways that were
difficult to understand how to manage.  Separated out primarily in to
new find_file() and open_file()/open_package() functions.

Also renamed other util functions for path-related things.
This commit is contained in:
Jon Siwek 2013-10-07 15:01:03 -05:00
parent 68227f112d
commit 90477df973
9 changed files with 331 additions and 304 deletions

View file

@ -226,7 +226,7 @@ bool RuleMatcher::ReadFiles(const name_list& files)
for ( int i = 0; i < files.length(); ++i )
{
rules_in = search_for_file(files[i], "sig", 0, false, 0);
rules_in = open_file(find_file(files[i], bro_path(), "sig"));
if ( ! rules_in )
{
reporter->Error("Can't open signature file %s", files[i]);