From 3fbc4104c833ba480752ef0e822d9d284a055e97 Mon Sep 17 00:00:00 2001 From: Andreas Guldstrand Date: Thu, 26 Nov 2015 04:39:36 +0100 Subject: Move seek in get_src_dir to inside the loop --- SBO-Lib/lib/SBO/Lib.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SBO-Lib/lib/SBO/Lib.pm b/SBO-Lib/lib/SBO/Lib.pm index 0f1eae2..0f67f1b 100644 --- a/SBO-Lib/lib/SBO/Lib.pm +++ b/SBO-Lib/lib/SBO/Lib.pm @@ -700,7 +700,6 @@ sub get_pkg_name { sub get_src_dir { exists $_[0] or script_error('get_src_dir requires an argument'); my $fh = shift; - seek $fh, 0, 0; my @src_dirs; # scripts use either $TMP or /tmp/SBo if (opendir(my $tsbo_dh, $tmpd)) { @@ -708,6 +707,7 @@ sub get_src_dir { next FIRST if $ls =~ /^\.[\.]{0,1}$/; next FIRST if $ls =~ /^package-/; my $found = 0; + seek $fh, 0, 0; SECOND: while (my $line = <$fh>) { if ($line =~ /$ls/) { $found++; -- cgit v1.2.3