Browse code

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

Guillaume J. Charmes authored on 2013/04/05 10:13:43
Showing 1 changed files
... ...
@@ -349,9 +349,11 @@ func CopyEscapable(dst io.Writer, src io.ReadCloser) (written int64, err error)
349 349
 		nr, er := src.Read(buf)
350 350
 		if nr > 0 {
351 351
 			// ---- Docker addition
352
-			if nr == 1 && buf[0] == '' {
352
+			// char 16 is C-p
353
+			if nr == 1 && buf[0] == 16 {
353 354
 				nr, er = src.Read(buf)
354
-				if nr == 1 && buf[0] == '' {
355
+				// char 17 is C-q
356
+				if nr == 1 && buf[0] == 17 {
355 357
 					if err := src.Close(); err != nil {
356 358
 						return 0, err
357 359
 					}