commit 3fbc4104c833ba480752ef0e822d9d284a055e97
parent 4a19ce0f3f99d8d74bd4d39bde2e01d9d4906fbd
Author: Andreas Guldstrand <andreas.guldstrand@gmail.com>
Date: Thu, 26 Nov 2015 04:39:36 +0100
Move seek in get_src_dir to inside the loop
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git 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++;