go.crypto/ssh/terminal: fix non-ASCII history.

The length of history buffer entries (which are stored as strings) was
being used as the number of runes. This was correct until ff9ce887b46b,
which allowed unicode entry, but can now cause a panic when editing
history that contains non-ASCII codepoints.

R=golang-dev, sfrithjof, r
CC=golang-dev
https://golang.org/cl/13255050
2 files changed
tree: 6b095242202e7c627db7809f0ccd2921069a037c
  1. terminal.go
  2. terminal_test.go
  3. util.go
  4. util_bsd.go
  5. util_linux.go