commit 83bb1cf716d5f44b773b952aa789aadac04171b2
Author: Oswald Buddenhagen <[email protected]>
Date: Sat Nov 16 13:21:45 2013 +0100
make state loading in showstate() similar to ckstate()
src/run-tests.pl | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/src/run-tests.pl b/src/run-tests.pl
index 5e72c87..10bca9c 100755
--- a/src/run-tests.pl
+++ b/src/run-tests.pl
@@ -362,34 +362,32 @@ sub showstate($)
print STDERR " Cannot read sync state $fn: $!\n";
return;
}
- $_ = <FILE>;
+ chomp(my @ls = <FILE>);
+ close FILE;
+ $_ = shift(@ls);
if (!defined $_) {
print STDERR " Missing sync state header.\n";
- close FILE;
return;
}
- if (!/^1:(\d+) 1:(\d+):(\d+)\n$/) {
- chomp;
+ if (!/^1:(\d+) 1:(\d+):(\d+)$/) {
print STDERR " Malformed sync state header '$_'.\n";
- close FILE;
return;
}
print " [ $1, $2, $3,\n ";
my $frst = 1;
- for (<FILE>) {
+ for (@ls) {
if ($frst) {
$frst = 0;
} else {
print ", ";
}
- if (!/^(-?\d+) (-?\d+) (.*)\n$/) {
+ if (!/^(-?\d+) (-?\d+) (.*)$/) {
print "??, ??, \"??\"";
} else {
print "$1, $2, \"$3\"";
}
}
print " ],\n";
- close FILE;
}
# $filename
------------------------------------------------------------------------------
Sponsored by Intel(R) XDK
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
isync-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/isync-devel