From a13ee797b79735913eeb16b456be15a0c68d5aaf Mon Sep 17 00:00:00 2001 From: ramonn Date: Mon, 30 Jan 2012 16:49:14 +0000 Subject: [PATCH] 2012-01-30 Ramon Novoa * modules/pandora_module_regexp.cc: Do not open the file in the constructor to avoid trouble if other modules modify it before the regexp module runs. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5448 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_agents/win32/ChangeLog | 6 ++++++ pandora_agents/win32/modules/pandora_module_regexp.cc | 6 ++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pandora_agents/win32/ChangeLog b/pandora_agents/win32/ChangeLog index fa21f2f402..8765af9bc3 100644 --- a/pandora_agents/win32/ChangeLog +++ b/pandora_agents/win32/ChangeLog @@ -1,3 +1,9 @@ +2012-01-30 Ramon Novoa + + * modules/pandora_module_regexp.cc: Do not open the file in the + constructor to avoid trouble if other modules modify it before + the regexp module runs. + 2012-01-19 Ramon Novoa * modules/pandora_module_odbc.cc: Check for NULL pointers. diff --git a/pandora_agents/win32/modules/pandora_module_regexp.cc b/pandora_agents/win32/modules/pandora_module_regexp.cc index 663ad11fb1..2b5778cca4 100755 --- a/pandora_agents/win32/modules/pandora_module_regexp.cc +++ b/pandora_agents/win32/modules/pandora_module_regexp.cc @@ -47,12 +47,10 @@ Pandora_Module_Regexp::Pandora_Module_Regexp (string name, string source, string pandoraLog ("Invalid regular expression %s", pattern.c_str ()); } - // Open the file and skip to the end + // Check whether the file can be opened this->file.open (source.c_str ()); if (this->file.is_open ()) { - if (no_seek_eof == 0) { - this->file.seekg (0, ios_base::end); - } + this->file.close (); } else { pandoraLog ("Error opening file %s", source.c_str ()); }