]> git.pond.sub.org Git - empserver/commitdiff
tests: Document log file normalization a bit better
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 5 Jan 2014 09:23:47 +0000 (10:23 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 6 Jan 2014 19:49:59 +0000 (20:49 +0100)
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
tests/normalize.pl

index efdeae9121ae299b73d684b9f19cce415be67d75..f2b2fd657e91cb305744d763a34709826911ae17 100755 (executable)
@@ -31,16 +31,18 @@ sub norm_ctime {
 while (<>) {
     chomp;
 
-    my $pfx = '';
-
+    # Strip log timestamp
     if ($opt_j || $opt_s) {
        die "$0: malformed line" unless /^$ctime_re /;
        $_ = substr($_, 25);
     }
 
+    # Split off prefix that is not to be normalized
+    my $pfx = '';
     if ($opt_j) {
        die "$0: malformed line" unless substr($_, 10, 1) eq ' ';
        $pfx .= substr($_, 0, 11);
+       # Normalize only player output
        $_ = substr($_, 11);
        if (/(^output [^ ]* 1 )(.*)/) {
            $pfx .= $1;