aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src
diff options
context:
space:
mode:
authorHenrik Nord <[email protected]>2013-11-21 11:00:39 +0100
committerHans Nilsson <[email protected]>2014-02-14 12:10:54 +0100
commit8071fde6f55056ef75b9b9836a6d75afa7e92ea2 (patch)
tree171c8c9cbd19fdfcdedd3db6a78e667ba9262af8 /lib/ssh/src
parent0b032d01637d039d508fa331c51ba24e8ae7f94e (diff)
downloadotp-8071fde6f55056ef75b9b9836a6d75afa7e92ea2.tar.gz
otp-8071fde6f55056ef75b9b9836a6d75afa7e92ea2.tar.bz2
otp-8071fde6f55056ef75b9b9836a6d75afa7e92ea2.zip
fix calculation of variable
thanks to Alexander Demidenko
Diffstat (limited to 'lib/ssh/src')
-rw-r--r--lib/ssh/src/ssh_cli.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ssh/src/ssh_cli.erl b/lib/ssh/src/ssh_cli.erl
index a53521c236..77453e8fd7 100644
--- a/lib/ssh/src/ssh_cli.erl
+++ b/lib/ssh/src/ssh_cli.erl
@@ -358,7 +358,7 @@ delete_chars(N, {Buf, BufTail, Col}, Tty) when N > 0 ->
{Buf, NewBufTail, Col}};
delete_chars(N, {Buf, BufTail, Col}, Tty) -> % N < 0
NewBuf = nthtail(-N, Buf),
- NewCol = Col + N,
+ NewCol = case Col + N of V when V >= 0 -> V; _ -> 0 end,
M1 = move_cursor(Col, NewCol, Tty),
M2 = move_cursor(NewCol + length(BufTail) - N, NewCol, Tty),
{[M1, BufTail, lists:duplicate(-N, $ ) | M2],