From 6e97b9a260e3030301947cd4888eda94a345685e Mon Sep 17 00:00:00 2001 From: Guillaume Boudreau Date: Wed, 15 Jan 2014 20:47:11 -0500 Subject: [PATCH] Bugfix: ignored_files & ignored_folders patterns needs to match the full filename/path --- greyhole | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/greyhole b/greyhole index 33e5a2af..8b9e25d6 100755 --- a/greyhole +++ b/greyhole @@ -1682,7 +1682,7 @@ function should_ignore_file($share, $full_path) { list($path, $filename) = explode_full_path($full_path); foreach ($ignored_files as $ignored_file_re) { - if (preg_match(';' . $ignored_file_re . ';', $filename)) { + if (preg_match(';^' . $ignored_file_re . '$;', $filename)) { gh_log(INFO, "Ignoring task because it matches the following ignored_files pattern: $ignored_file_re"); return TRUE; } @@ -1690,7 +1690,7 @@ function should_ignore_file($share, $full_path) { foreach ($ignored_folders as $ignored_folder_re) { $p = clean_dir("$share/$path"); gh_log(DEBUG, "Looking for ignore match between $p and $ignored_folder_re"); - if (preg_match(';' . $ignored_folder_re . ';', $p)) { + if (preg_match(';^' . $ignored_folder_re . '$;', $p)) { gh_log(INFO, "Ignoring task because it matches the following ignored_folders pattern: $ignored_folder_re"); return TRUE; }