diff --git a/ext/pty/lib/expect.rb b/ext/pty/lib/expect.rb index 1729482e04..5dbfa09ae9 100644 --- a/ext/pty/lib/expect.rb +++ b/ext/pty/lib/expect.rb @@ -57,7 +57,7 @@ class IO STDOUT.flush end if mat=e_pat.match(buf) then - result = [buf,*mat.to_a[1..-1]] + result = [buf,*mat.captures] break end end