From 5238826dc668df2dafc47f3b26e5862ff1db7591 Mon Sep 17 00:00:00 2001 From: Jacob Pipkin Date: Thu, 30 Aug 2012 07:54:37 -0500 Subject: first stage applying changes from slack14 rewrite back into slack13.37 version --- sbofind | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'sbofind') diff --git a/sbofind b/sbofind index 5e8931d..c530217 100755 --- a/sbofind +++ b/sbofind @@ -18,7 +18,7 @@ use warnings FATAL => 'all'; my %config = %SBO::Lib::config; my $self = basename ($0); -sub show_usage { +sub show_usage () { print <) { - if ($found eq 'FALSE') { - $found = 'TRUE', next FIRST if $name = ($line =~ $name_regex)[0]; + unless ($found) { + $found++, next FIRST if $name = ($line =~ $name_regex)[0]; } else { if (my ($location) = ($line =~ $loc_regex)[0]) { - $found = 'FALSE'; + $found = 0; $location =~ s#^\.##; push @findings, {$name => $config{SBO_HOME} . $location}; } @@ -68,9 +68,9 @@ FIRST: while (my $line = <$fh>) { } sub get_file_contents { - exists $_[0] or script_error ('get_file_contents requires an argument'); - -f $_[0] or script_error ('get_file_contents argument is not a file'); - my $fh = open_read (shift); + exists $_[0] or script_error 'get_file_contents requires an argument'; + -f $_[0] or script_error 'get_file_contents argument is not a file'; + my $fh = open_read shift; my $contents = do {local $/; <$fh>}; $contents =~ s/\n/\n /g; $contents =~ s/ $//g; -- cgit v1.2.3