]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
removed bug, that lines with # were ignored, mt
authorhadaq <hadaq>
Thu, 15 Nov 2012 00:17:57 +0000 (00:17 +0000)
committerhadaq <hadaq>
Thu, 15 Nov 2012 00:17:57 +0000 (00:17 +0000)
merge_serial_address.pl

index c8a5d874f9bd449bd5e6967563d4a16f2fec31ac..8684ecdf277ba218da0997615960e0880897d649 100755 (executable)
@@ -21,8 +21,9 @@ trb_init_ports() or die trb_strerror();
 
 my %trb;
 foreach my $cur_ln (<$fh1>) {
-    next if($cur_ln =~ /\s*#/ or $cur_ln =~ /^\s*$/);
+    next if($cur_ln =~ /^\s*#/ or $cur_ln =~ /^\s*$/);
     (my $serial_nr, my $uid) = $cur_ln =~ /(\d+)\s+(\w+)/;
+    next if (!defined $serial_nr);
     $serial_nr = int($serial_nr);
     $trb{$serial_nr}->{'uid'} = $uid;
 }
@@ -30,9 +31,10 @@ foreach my $cur_ln (<$fh1>) {
 #print Dumper \%trb;
 
 foreach my $cur_ln (<$fh2>) {
-    next if($cur_ln =~ /\s*#/ or $cur_ln =~ /^\s*$/);
+    next if($cur_ln =~ /^\s*#/ or $cur_ln =~ /^\s*$/);
     (my $address, my $sernr1, my $sernr2) = $cur_ln =~ /(\w+)\s+(\d+)\s+(\d+)/;
     my $serial_nr = $sernr1*10 + $sernr2;
+    next if (!defined $serial_nr);
     $trb{$serial_nr}->{'address'} = hex($address);
     $trb{$serial_nr}->{'endpoint_nr'} = $sernr2;
 }