From 98e5ebd65696db59063e45ee16da0f0923eda64a Mon Sep 17 00:00:00 2001 From: Jamie McClelland Date: Tue, 21 Dec 2010 23:29:15 -0500 Subject: avoid problems with filenames containing regexp special characters. --- examples/monkeysphere-monitor-keys | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/examples/monkeysphere-monitor-keys b/examples/monkeysphere-monitor-keys index a5877d6..c5d0a0f 100755 --- a/examples/monkeysphere-monitor-keys +++ b/examples/monkeysphere-monitor-keys @@ -104,6 +104,7 @@ sub get_watcher { push(@dirs,$dir); my $file = basename($file); if ( !grep $_ eq $file, @filters ) { + $file = quotemeta($file); debug("Adding file filter: %s\n", $file); push(@filters,$file); } @@ -111,10 +112,6 @@ sub get_watcher { } # create combined file filters to limit our monitor - - # FIXME: what if the elements of @filters have some regex characters - # in them? this seems like it could match all kinds of crazy stuff - my $filter = '^(' . join("|",@filters) . ')$'; # return a watcher object -- cgit v1.2.3