aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2017-11-09 12:35:12 +0100
committerHans Nilsson <[email protected]>2017-11-09 12:35:12 +0100
commit638f0faf282218089cdbf636bf487a7cad95a621 (patch)
tree4103f14a59b1c3822697e8701d6e37e5f1b4a3d3 /lib
parent19e938e708bb4823d5deac94fd110b7d3896390a (diff)
downloadotp-638f0faf282218089cdbf636bf487a7cad95a621.tar.gz
otp-638f0faf282218089cdbf636bf487a7cad95a621.tar.bz2
otp-638f0faf282218089cdbf636bf487a7cad95a621.zip
ssh: Don't remove trailing WS in Hello msg
Diffstat (limited to 'lib')
-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 5391df723c..b2d655955f 100644
--- a/lib/ssh/src/ssh_transport.erl
+++ b/lib/ssh/src/ssh_transport.erl
@@ -1825,12 +1825,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).