mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-30 08:34:16 +01:00
print header elems, including md5sum, if present rather than just
skipping.
This commit is contained in:
parent
5fa9b60846
commit
8e58d8c1c0
1 changed files with 13 additions and 1 deletions
|
@ -156,6 +156,18 @@ sub readNodesToEnd($) {
|
|||
return @nodes;
|
||||
} # readNodesToEnd
|
||||
|
||||
sub printHeader($$) {
|
||||
my ( $buf, $len ) = @_;
|
||||
printf STDERR "skipped %d bytes of header:\n", $len + 2;
|
||||
my $asStr = Encode::decode_utf8($buf);
|
||||
my @strs = split( '\0', $asStr );
|
||||
foreach my $str (@strs) {
|
||||
if ( 0 < length($str) ) {
|
||||
print STDERR 'Got: ', $str, "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub nodeSizeFromFlags($$) {
|
||||
my ( $fh, $flags ) = @_;
|
||||
|
||||
|
@ -167,7 +179,7 @@ sub nodeSizeFromFlags($$) {
|
|||
2 == sysread( $fh, $buf, 2 ) || die "couldn't read length of header";
|
||||
my $len = unpack( "n", $buf );
|
||||
$len == sysread( $fh, $buf, $len ) || die "couldn't read header bytes";
|
||||
printf STDERR "skipped %d bytes of header\n", $len + 2;
|
||||
printHeader( $buf, $len );
|
||||
}
|
||||
|
||||
if ( $flags == 2 || $ flags == 4 ) {
|
||||
|
|
Loading…
Add table
Reference in a new issue