Use integers instead of non-printable chars in the escape sequence detection

Upstream-commit: 626bfd87a7eadd64b16fb02d547f75d1a8f94aa7
Component: engine
This commit is contained in:
Guillaume J. Charmes
2013-04-04 18:13:43 -07:00
parent 086efb3f6d
commit 4a464fa427

View File

@ -349,9 +349,11 @@ func CopyEscapable(dst io.Writer, src io.ReadCloser) (written int64, err error)
nr, er := src.Read(buf)
if nr > 0 {
// ---- Docker addition
if nr == 1 && buf[0] == '' {
// char 16 is C-p
if nr == 1 && buf[0] == 16 {
nr, er = src.Read(buf)
if nr == 1 && buf[0] == '' {
// char 17 is C-q
if nr == 1 && buf[0] == 17 {
if err := src.Close(); err != nil {
return 0, err
}