diff options
author | Darren Tucker <dtucker@cvs.openbsd.org> | 2012-09-07 00:30:20 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@cvs.openbsd.org> | 2012-09-07 00:30:20 +0000 |
commit | 3b4f333056c85c187f289cc2be3f696949df4c4a (patch) | |
tree | e575fb089976ff7b1016afaa22a08514abbc9bea /usr.bin | |
parent | d9cdc249c690beb4676aafd1dadc4e07db4bb751 (diff) |
Print '^Z' instead of a raw ^Z when the sequence is not supported. ok djm@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ssh/clientloop.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.bin/ssh/clientloop.c b/usr.bin/ssh/clientloop.c index 5345031f127..f9fa440f2a9 100644 --- a/usr.bin/ssh/clientloop.c +++ b/usr.bin/ssh/clientloop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clientloop.c,v 1.244 2012/09/06 09:50:13 dtucker Exp $ */ +/* $OpenBSD: clientloop.c,v 1.245 2012/09/07 00:30:19 dtucker Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -1105,11 +1105,16 @@ process_escapes(Channel *c, Buffer *bin, Buffer *bout, Buffer *berr, case 'Z' - 64: /* XXX support this for mux clients */ if (c && c->ctl_chan != -1) { + char b[16]; noescape: + if (ch == 'Z' - 64) + snprintf(b, sizeof b, "^Z"); + else + snprintf(b, sizeof b, "%c", ch); snprintf(string, sizeof string, - "%c%c escape not available to " + "%c%s escape not available to " "multiplexed sessions\r\n", - escape_char, ch); + escape_char, b); buffer_append(berr, string, strlen(string)); continue; |