aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2017-11-09 12:35:12 +0100
committerHans Nilsson <[email protected]>2017-11-15 15:05:20 +0100
commit70773b1498cb845db16ed83f3f4c3b1b52e08ab2 (patch)
treee8e65c138a564bd1140b4143866f8c46d7ff5c14 /lib/ssh/src
parent84f29ab803e8f36ef058a47f4c2b224f4dd58220 (diff)
downloadotp-70773b1498cb845db16ed83f3f4c3b1b52e08ab2.tar.gz
otp-70773b1498cb845db16ed83f3f4c3b1b52e08ab2.tar.bz2
otp-70773b1498cb845db16ed83f3f4c3b1b52e08ab2.zip
ssh: Don't remove trailing WS in Hello msg
Diffstat (limited to 'lib/ssh/src')
-rw-r--r--lib/ssh/src/ssh_transport.erl12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/ssh/src/ssh_transport.erl b/lib/ssh/src/ssh_transport.erl
index 0052347912..6d158537d4 100644
--- a/lib/ssh/src/ssh_transport.erl
+++ b/lib/ssh/src/ssh_transport.erl
@@ -1987,12 +1987,6 @@ same(Algs) -> [{client2server,Algs}, {server2client,Algs}].
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
trim_tail(Str) ->
- lists:reverse(trim_head(lists:reverse(Str))).
-
-trim_head([$\s|Cs]) -> trim_head(Cs);
-trim_head([$\t|Cs]) -> trim_head(Cs);
-trim_head([$\n|Cs]) -> trim_head(Cs);
-trim_head([$\r|Cs]) -> trim_head(Cs);
-trim_head(Cs) -> Cs.
-
-
+ lists:takewhile(fun(C) ->
+ C=/=$\r andalso C=/=$\n
+ end, Str).