Issue #3622 has been updated by Hiroshi NAKAMURA.

File expect-continue.diff added

Here's a modified version of the patch. [expect-continue.diff]
I'll write test case.

Eric: Would you please confirm that this patch works for you? Thanks in a=
dvance.
----------------------------------------
http://redmine.ruby-lang.org/issues/show/3622

----------------------------------------
http://redmine.ruby-lang.org
SW5kZXg6IGxpYi9uZXQvaHR0cC5yYgo9PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
Ci0tLSBsaWIvbmV0L2h0dHAucmIJKHJldmlzaW9uIDI5MjAxKQorKysgbGli
L25ldC9odHRwLnJiCSh3b3JraW5nIGNvcHkpCkBAIC01MTcsNiArNTE3LDcg
QEAKICAgICAgIEBzdGFydGVkID0gZmFsc2UKICAgICAgIEBvcGVuX3RpbWVv
dXQgPSBuaWwKICAgICAgIEByZWFkX3RpbWVvdXQgPSA2MAorICAgICAgQGNv
bnRpbnVlX3RpbWVvdXQgPSBuaWwKICAgICAgIEBkZWJ1Z19vdXRwdXQgPSBu
aWwKICAgICAgIEB1c2Vfc3NsID0gZmFsc2UKICAgICAgIEBzc2xfY29udGV4
dCA9IG5pbApAQCAtNTcwLDYgKzU3MSwxNiBAQAogICAgICAgQHJlYWRfdGlt
ZW91dCA9IHNlYwogICAgIGVuZAogCisgICAgIyBTZWNvbmRzIHRvIHdhaXQg
Zm9yIDEwMCBDb250aW51ZSByZXNwb25zZS4gIElmIHRoZSBIVFRQIG9iamVj
dCBkb2VzIG5vdAorICAgICMgcmVjZWl2ZSBhIHJlc3BvbnNlIGluIHRoaXMg
bWFueSBzZWNvbmRzIGl0IHNlbmRzIHRoZSByZXF1ZXN0IGJvZHkuCisgICAg
YXR0cl9yZWFkZXIgOmNvbnRpbnVlX3RpbWVvdXQKKworICAgICMgU2V0dGVy
IGZvciB0aGUgY29udGludWVfdGltZW91dCBhdHRyaWJ1dGUuCisgICAgZGVm
IGNvbnRpbnVlX3RpbW91dD0oc2VjKQorICAgICAg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YWxpemUoaW8pCiAgICAgICBAaW8gPSBpbwogICAgICAgQHJlYWRfdGlt
ZW91dCA9IDYwCisgICAgICBAY29udGludWVfdGltZW91dCA9IDAuNQogICAg
ICAgQGRlYnVnX291dHB1dCA9IG5pbAogICAgICAgQHJidWYgPSAnJwogICAg
IGVuZAogCiAgICAgYXR0cl9yZWFkZXIgOmlvCiAgICAgYXR0cl9hY2Nlc3Nv
ciA6cmVhZF90aW1lb3V0CisgICAgYXR0cl9hY2Nlc3NvciA6Y29udGludWVf
dGltZW91dAogICAgIGF0dHJfYWNjZXNzb3IgOmRlYnVnX291dHB1dAogCiAg
ICAgZGVmIGluc3BlY3QK