From: Karel Zak Date: Tue, 25 Jan 2022 15:31:02 +0000 (+0100) Subject: script: add separator to header, update tests X-Git-Tag: v2.38-rc1~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4eda4ec8af067702fcb23ec50a541411c5845594;p=thirdparty%2Futil-linux.git script: add separator to header, update tests * add separator before "" * update test (due to 4d8edee5eeb3ea5457eeff321bca7dd64108eb8f) Signed-off-by: Karel Zak --- diff --git a/term-utils/script.c b/term-utils/script.c index afd43eb515..ec9536477e 100644 --- a/term-utils/script.c +++ b/term-utils/script.c @@ -409,10 +409,10 @@ static int log_start(struct script_control *ctl, if (ctl->ttyname) x += fprintf(log->fp, "%*sTTY=\"%s\"", !!x, "", ctl->ttyname); - fprintf(log->fp, "%*sCOLUMNS=\"%d\" LINES=\"%d\"", !!x, "", + x += fprintf(log->fp, "%*sCOLUMNS=\"%d\" LINES=\"%d\"", !!x, "", ctl->ttycols, ctl->ttylines); } else - fprintf(log->fp, _("")); + fprintf(log->fp, _("%*s"), !!x, ""); fputs("]\n", log->fp); break; diff --git a/tests/expected/script/options-append b/tests/expected/script/options-append index f18c47b94a..584d921b11 100644 --- a/tests/expected/script/options-append +++ b/tests/expected/script/options-append @@ -1,8 +1,8 @@ -Script started on 2015-05-24 17:43:18+00:00 [] +Script started on 2015-05-24 17:43:18+00:00 [COMMAND="echo append1" ] append1 Script done on 2015-05-24 17:43:18+00:00 [COMMAND_EXIT_CODE="0"] -Script started on 2015-05-24 17:43:18+00:00 [] +Script started on 2015-05-24 17:43:18+00:00 [COMMAND="echo append2" ] append2 Script done on 2015-05-24 17:43:18+00:00 [COMMAND_EXIT_CODE="0"] diff --git a/tests/expected/script/options-force b/tests/expected/script/options-force index d8c005a2d7..7b9854ee0e 100644 --- a/tests/expected/script/options-force +++ b/tests/expected/script/options-force @@ -2,12 +2,12 @@ test_script: output file `typescript' is a link Use --force if you really want to use it. Program not started. 1 -Script started on 2015-05-24 17:43:18+00:00 [] +Script started on 2015-05-24 17:43:18+00:00 [COMMAND="echo with force" ] with force Script done on 2015-05-24 17:43:18+00:00 [COMMAND_EXIT_CODE="0"] 0 -Script started on 2015-05-24 17:43:18+00:00 [] +Script started on 2015-05-24 17:43:18+00:00 [COMMAND="echo not typescript" ] not typescript Script done on 2015-05-24 17:43:18+00:00 [COMMAND_EXIT_CODE="0"] diff --git a/tests/expected/script/options-quiet b/tests/expected/script/options-quiet index a06b6a1952..9718d17060 100644 --- a/tests/expected/script/options-quiet +++ b/tests/expected/script/options-quiet @@ -1,8 +1,8 @@ -Script started on 2015-05-24 17:43:18+00:00 [] +Script started on 2015-05-24 17:43:18+00:00 [COMMAND="echo quiet1" ] quiet1 Script done on 2015-05-24 17:43:18+00:00 [COMMAND_EXIT_CODE="0"] -Script started on 2015-05-24 17:43:18+00:00 [] +Script started on 2015-05-24 17:43:18+00:00 [COMMAND="echo quiet2" ] quiet2 Script done on 2015-05-24 17:43:18+00:00 [COMMAND_EXIT_CODE="0"] diff --git a/tests/expected/script/options-return b/tests/expected/script/options-return index 437aea6005..94cd86098e 100644 --- a/tests/expected/script/options-return +++ b/tests/expected/script/options-return @@ -1,16 +1,16 @@ -Script started on 2015-05-24 17:43:18+00:00 [] +Script started on 2015-05-24 17:43:18+00:00 [COMMAND="exit 1" ] Script done on 2015-05-24 17:43:18+00:00 [COMMAND_EXIT_CODE="1"] 0 -Script started on 2015-05-24 17:43:18+00:00 [] +Script started on 2015-05-24 17:43:18+00:00 [COMMAND="exit 0" ] Script done on 2015-05-24 17:43:18+00:00 [COMMAND_EXIT_CODE="0"] 0 -Script started on 2015-05-24 17:43:18+00:00 [] +Script started on 2015-05-24 17:43:18+00:00 [COMMAND="exit 42" ] Script done on 2015-05-24 17:43:18+00:00 [COMMAND_EXIT_CODE="42"] 42 -Script started on 2015-05-24 17:43:18+00:00 [] +Script started on 2015-05-24 17:43:18+00:00 [COMMAND="exit 127" ] Script done on 2015-05-24 17:43:18+00:00 [COMMAND_EXIT_CODE="127"] 127 diff --git a/tests/expected/script/options-size b/tests/expected/script/options-size index 459424b14d..bdbe688af0 100644 --- a/tests/expected/script/options-size +++ b/tests/expected/script/options-size @@ -1,8 +1,8 @@ -Script started on 2015-05-24 17:43:18+00:00 [] +Script started on 2015-05-24 17:43:18+00:00 [COMMAND="echo 1:1234567890" ] 1:1234567890 Script done on 2015-05-24 17:43:18+00:00 [] -Script started on 2015-05-24 17:43:18+00:00 [] +Script started on 2015-05-24 17:43:18+00:00 [COMMAND="echo 2:1234567890" ] 2:1234567890 Script done on 2015-05-24 17:43:18+00:00 []