Commits

Palmer, 2E0EOL  committed 1cce1cf Draft

Supress multiple lines of * output

  • Participants
  • Parent commits c1b2885
  • Branches develop

Comments (0)

Files changed (1)

 	return 1;
 }
 
-sub PrintRow($$$) {
-	my ( $Offset, $Line, $LastLine ) = @_;
+sub PrintRow($$$$) {
+	my ( $Offset, $Line, $LastLine, $supressed ) = @_;
 	my ( $hex, $printable ) = ( '', '' );
 	my $printed_count = 0;
 	my $hexPadding;
 	my $elems = scalar(@$Line);
 
 	if ( $LastLine && CompareRows($Line, $LastLine) ) {
-		print("*\n");
+		if ( $supressed && !$$supressed ) {
+			print("*\n");
+			$$supressed = 1;
+		}
 		return;
 	}
 
+	$$supressed = 0 if ( $supressed );
 	for ( my $i = 0; $i < $elems; $i++ ) {
 		my $char = $Line->[$i];
 		$hex .= sprintf('%02x', ord($char));
 	$/ = '';
 	my @line = ( );
 	my @last_line = ( );
+	my $supressed = 0;
 	my $counter = 0;
 
 	while ( !eof($File) ) {
 		$counter++;
 		push(@line, $char);
 		if ( $counter % PARAGRAPH_LENGTH() == 0 ) {
-			PrintRow($counter, \@line, \@last_line);
+			PrintRow($counter, \@line, \@last_line, \$supressed);
 			@last_line = @line;
 			@line = ( );
 		}
 	}
-	PrintRow($counter, \@line, undef); # Anything remaining.
+	PrintRow($counter, \@line, undef, undef); # Anything remaining.
 }
 
 sub Main() {