summaryrefslogtreecommitdiffstats
path: root/misc-utils/scriptreplay.c
diff options
context:
space:
mode:
authorKarel Zak2008-07-30 12:39:04 +0200
committerKarel Zak2008-08-13 11:54:13 +0200
commit0c723f3490df9ee9a5e133de374a06b06fdad76f (patch)
tree33e73b0779af1ef6880dcce6fbe95bdde968d94a /misc-utils/scriptreplay.c
parenthwclock: read_hardware_clock_rtc() need to return error codes (diff)
downloadkernel-qcow2-util-linux-0c723f3490df9ee9a5e133de374a06b06fdad76f.tar.gz
kernel-qcow2-util-linux-0c723f3490df9ee9a5e133de374a06b06fdad76f.tar.xz
kernel-qcow2-util-linux-0c723f3490df9ee9a5e133de374a06b06fdad76f.zip
scriptreplay: new implementation is out-of-sync
Reproduction steps: 1. Run "script -t 2>timing". 2. When the prompt comes up, hit return. 3. New prompt. Wait several seconds, then type "true" and hit return. 4. Repeat (3) as desired, then exit scripted shell. 5. Run "scriptreplay timing". You'll find on the replay that, rather than waiting several seconds between the prompt and true, the wait will actually occur after the first "t" of true. Reported-by: Micah Cowan <micah@cowan.name> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils/scriptreplay.c')
-rw-r--r--misc-utils/scriptreplay.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/misc-utils/scriptreplay.c b/misc-utils/scriptreplay.c
index 6c351a35a..8a254de9d 100644
--- a/misc-utils/scriptreplay.c
+++ b/misc-utils/scriptreplay.c
@@ -121,6 +121,7 @@ main(int argc, char *argv[])
double divi;
int c;
unsigned long line;
+ size_t oldblk = 0;
/* Because we use space as a separator, we can't afford to use any
* locale which tolerates a space in a number. In any case, script.c
@@ -170,7 +171,9 @@ main(int argc, char *argv[])
if (delay > SCRIPT_MIN_DELAY)
delay_for(delay);
- emit(sfile, sname, blk);
+ if (oldblk)
+ emit(sfile, sname, oldblk);
+ oldblk = blk;
}
fclose(sfile);