<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Alexander!<br>
<br>
I have created a pull request for this to make sure it will get into
the system and assigned to the proper team etc.<br>
<br>
Thank you for your contribution!<br>
<br>
<div class="moz-cite-prefix">On 2013-11-21 03:51, Alexander
Demidenko wrote:<br>
</div>
<blockquote
cite="mid:CAN0YpQ9HJ62wn_-fht2M6JVx2PxgGGVV=2qE8Z0f0z3Xgz8rbA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div>Hello, friends.</div>
<div><br>
</div>
<div>How can I see, in the ssh_cli.erl module, delete_chars
method incorrectly calculate variable "NewCol".</div>
<div><br>
</div>
<div>I can offer the option of a patch that fixes this
problem.</div>
<div>The person who is responsible for supporting ssh has the
discretion to take it as it is, or can make own fix.</div>
<div>Tested by Erlang 16B02, ssh 2.1.8 and R15B02, ssh 2.1.1</div>
<div><br>
</div>
<div>hurd@insider:~/Documents/Erlang/reports/ssh_expand_test$
cat ssh.patch </div>
<div>--- ssh-2.1.1/src/ssh_cli.erl<span class=""
style="white-space:pre"> </span>2013-10-26
14:25:26.000000000 </div>
<div>+++ ssh-2.1.2/src/ssh_cli.erl<span class=""
style="white-space:pre"> </span>2013-10-26
14:18:18.000000000</div>
<div>@@ -311,13 +319,14 @@</div>
<div> NewBufTail = nthtail(N, BufTail),</div>
<div> M = move_cursor(Col + length(NewBufTail) + N, Col,
Tty),</div>
<div> {[NewBufTail, lists:duplicate(N, $ ) | M],</div>
<div> {Buf, NewBufTail, Col}};</div>
<div> delete_chars(N, {Buf, BufTail, Col}, Tty) -> % N <
0</div>
<div> NewBuf = nthtail(-N, Buf),</div>
<div>- NewCol = Col + N,</div>
<div>+ NewCol = case Col + N of V when V >= 0 -> V; _
-> 0 end,</div>
<div> M1 = move_cursor(Col, NewCol, Tty),</div>
<div> M2 = move_cursor(NewCol + length(BufTail) - N,
NewCol, Tty),</div>
<div> {[M1, BufTail, lists:duplicate(-N, $ ) | M2],</div>
<div> {NewBuf, BufTail, NewCol}}.</div>
<div> </div>
<div> %%% Window change, redraw the current line (and clear
out after it </div>
<div><br>
</div>
<div><br>
</div>
<div>I attached simple sample, where you can see this problem.</div>
<div>To run it, compile ssh_manager.erl and invoke
"ssh_manager:start()" method to run ssh-daemon.</div>
<div>Then run simple ssh-client on terminal to localhost on
port 9999, and entering the password "test".</div>
<div>(you need put keys in .ssh folder)</div>
<div>Below example show trouble with the display of available
commands when you press Tab.</div>
<div><br>
</div>
<div>At the command prompt "ssh_app:"</div>
<div>_____________________________________________________</div>
<div>1> ssh_app:</div>
<div>_____________________________________________________</div>
<div><br>
</div>
<div>Press tab.</div>
<div>_____________________________________________________</div>
<div>1> ssh_app:</div>
<div>module_info/0 module_info/1 start/2 stop/1</div>
<div>1> ssh_app:</div>
<div>_____________________________________________________</div>
<div><br>
</div>
<div>You will see the line below "module_info/0 module_info/1
start/2 stop/1," and below that "ssh_app:".</div>
<div>Everything is wonderful. Yet.</div>
<div><br>
</div>
<div>Do the following: Go to the new line (Press enter) and
enter a space as long as the input field team did not go on
the line below .</div>
<div>_____________________________________________________</div>
<div>1></div>
<div> </div>
<div>_____________________________________________________</div>
<div><br>
</div>
<div>Enter "ssh_app:"</div>
<div><br>
</div>
<div>_____________________________________________________</div>
<div>1></div>
<div> ssh_app:</div>
<div>_____________________________________________________</div>
<div><br>
</div>
<div>
Press tab.</div>
<div>_____________________________________________________</div>
<div>1></div>
<div> ssh_app:</div>
<div>1></div>
<div> ssh_app:</div>
<div>_____________________________________________________</div>
<div><br>
</div>
<div>You will see that the tab has not worked. The string
"module_info/0 module_info/1 start/2 stop/1" was not
withdrawn.</div>
<div>This is not good.</div>
<div><br>
</div>
<div>You still can do the following: Go to the new line (press
the button enter) and enter a space as long as the input
field team did not go on 2 lines below.</div>
<div>_____________________________________________________</div>
<div>1></div>
<div> </div>
<div>_____________________________________________________</div>
<div><br>
</div>
<div>Enter "ssh_app:".</div>
<div>____________________________________________________</div>
<div>1></div>
<div> ssh_app:</div>
<div>_____________________________________________________</div>
<div><br>
</div>
<div>Press tab.</div>
<div><br>
</div>
<div>_____________________________________________________</div>
<div>1></div>
<div> </div>
<div>1></div>
<div><br>
</div>
<div> ssh_app:</div>
<div>_____________________________________________________</div>
<div><br>
</div>
<div>You will see that the tab has not worked. The string
"module_info/0 module_info/1 start/2 stop/1" was not
withdrawn. This is not good.</div>
</div>
<div><br>
</div>
-- <br>
---------------------------------------------<br>
With best regards,<br>
Alexander.
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
erlang-patches mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-patches@erlang.org">erlang-patches@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-patches">http://erlang.org/mailman/listinfo/erlang-patches</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
/Henrik Nord Erlang/OTP</pre>
</body>
</html>