diff options
author | Jamie McClelland <jm@mayfirst.org> | 2010-12-21 23:29:15 -0500 |
---|---|---|
committer | Jamie McClelland <jm@mayfirst.org> | 2010-12-21 23:29:15 -0500 |
commit | 98e5ebd65696db59063e45ee16da0f0923eda64a (patch) | |
tree | 4abff4e0b109fd1c55a7fcc587a9d66e913bd58b | |
parent | 368d659a675f2682ab8d1d2c9dad12928f49bfb4 (diff) |
avoid problems with filenames containing regexp special characters.
-rwxr-xr-x | examples/monkeysphere-monitor-keys | 5 |
1 files changed, 1 insertions, 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 |