aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Guldstrand <andreas.guldstrand@gmail.com>2016-03-05 14:36:00 +0100
committerAndreas Guldstrand <andreas.guldstrand@gmail.com>2016-03-05 14:36:00 +0100
commit9dda3a026005a13391bbf4526a79275ec2b78c8f (patch)
treeeb6d885d20db65801c3f0910280ac103dd809880
parent0ee5936d8d2b4dbcbb5163343955561eb3548905 (diff)
downloadsbotools2-9dda3a026005a13391bbf4526a79275ec2b78c8f.tar.xz
We don't want to treat the TAGS.txt names as partial matches. See #37.
-rwxr-xr-xsbofind4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbofind b/sbofind
index 0ba22a3..65f05c3 100755
--- a/sbofind
+++ b/sbofind
@@ -89,8 +89,8 @@ sub perform_search {
next FIRST unless $line =~ /NAME:/;
# Try to match either the search string or any of the names from the TAGS.txt
- foreach my $search ($search_arg, @names) {
- if (my ($name) = $line =~ /NAME:\s+(.*\Q$search\E.*)$/i) {
+ foreach my $search (".*" . quotemeta($search_arg) . ".*", map { quotemeta } @names) {
+ if (my ($name) = $line =~ /NAME:\s+($search)$/i) {
# If the name matches a local override, use its location
if ($config{LOCAL_OVERRIDES} ne 'FALSE' and -d "$config{LOCAL_OVERRIDES}/$name") {