]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
script: default to new format when new features expected
authorKarel Zak <kzak@redhat.com>
Thu, 20 Jun 2019 09:50:15 +0000 (11:50 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 8 Oct 2019 11:11:53 +0000 (13:11 +0200)
The old format should be the default for stdout only.

Signed-off-by: Karel Zak <kzak@redhat.com>
term-utils/script.c

index 6569c98f4907321787aaeef6e8c9cc0542d33942..7d684886d89f9a4ea190da7abef10721187dcd49 100644 (file)
@@ -1063,8 +1063,11 @@ int main(int argc, char **argv)
        }
 
        if (timingfile) {
+               /* the old SCRIPT_FMT_TIMING_SIMPLE should be used when
+                * recoding output only (just for backward compatibility),
+                * otherwise switch to new format. */
                if (!format)
-                       format = outfile && infile ?
+                       format = infile || (outfile && infile) ?
                                        SCRIPT_FMT_TIMING_MULTI :
                                        SCRIPT_FMT_TIMING_SIMPLE;