aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2017-11-16 14:56:00 +0100
committerHans Nilsson <[email protected]>2017-11-16 14:56:00 +0100
commit12e3758d65c6fc6d42642fb7d4f59ac9f10081f6 (patch)
treed582494b9101fa03f4fd12343e67c1ac8d3b9891 /lib/ssh/src
parent70defe957f68f5ad4a4957af29c8713556074995 (diff)
parent70213bdf6cfa2e61c7e9013c4c217a1857b9df2e (diff)
downloadotp-12e3758d65c6fc6d42642fb7d4f59ac9f10081f6.tar.gz
otp-12e3758d65c6fc6d42642fb7d4f59ac9f10081f6.tar.bz2
otp-12e3758d65c6fc6d42642fb7d4f59ac9f10081f6.zip
Merge branch 'maint-18' into maint
* maint-18: Updated OTP version Prepare release ssh: Unicode encoding fix ssh: testcases for space trailing Hello msg Remove unused test include file from test suites eldap: Repair Makefile ssh: Don't remove trailing WS in Hello msg Conflicts: OTP_VERSION erts/doc/src/notes.xml erts/vsn.mk lib/compiler/doc/src/notes.xml lib/compiler/vsn.mk lib/crypto/test/blowfish_SUITE.erl lib/eldap/doc/src/notes.xml lib/eldap/vsn.mk lib/inets/test/httpd_load.erl lib/inets/test/httpd_mod.erl lib/inets/test/old_httpd_SUITE.erl lib/ssh/doc/src/notes.xml lib/ssh/vsn.mk lib/stdlib/test/zip_SUITE.erl otp_versions.table
Diffstat (limited to 'lib/ssh/src')
-rw-r--r--lib/ssh/src/ssh.hrl2
-rw-r--r--lib/ssh/src/ssh_transport.erl12
2 files changed, 4 insertions, 10 deletions
diff --git a/lib/ssh/src/ssh.hrl b/lib/ssh/src/ssh.hrl
index d6d412db43..3dee1c5521 100644
--- a/lib/ssh/src/ssh.hrl
+++ b/lib/ssh/src/ssh.hrl
@@ -63,8 +63,8 @@
-define(uint16(X), << ?UINT16(X) >> ).
-define(uint32(X), << ?UINT32(X) >> ).
-define(uint64(X), << ?UINT64(X) >> ).
--define(string(X), << ?STRING(list_to_binary(X)) >> ).
-define(string_utf8(X), << ?STRING(unicode:characters_to_binary(X)) >> ).
+-define(string(X), ?string_utf8(X)).
-define(binary(X), << ?STRING(X) >>).
%% Cipher details
diff --git a/lib/ssh/src/ssh_transport.erl b/lib/ssh/src/ssh_transport.erl
index 892db6b64f..90a94a7e86 100644
--- a/lib/ssh/src/ssh_transport.erl
+++ b/lib/ssh/src/ssh_transport.erl
@@ -2027,12 +2027,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).