diff options
author | Hans Bolinder <[email protected]> | 2017-06-28 13:05:53 +0200 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2017-07-06 17:53:22 +0200 |
commit | 792450913beef0b2eec3e3b0a4ebad14563ecadb (patch) | |
tree | 95080fad454bda3ceda26739d775765d62a7aea4 /lib/stdlib/src/escript.erl | |
parent | e2b9eb8735416ded58fbcdfbe11a90b7885f8a31 (diff) | |
download | otp-792450913beef0b2eec3e3b0a4ebad14563ecadb.tar.gz otp-792450913beef0b2eec3e3b0a4ebad14563ecadb.tar.bz2 otp-792450913beef0b2eec3e3b0a4ebad14563ecadb.zip |
stdlib: Do not use deprecated functions in string(3)
Diffstat (limited to 'lib/stdlib/src/escript.erl')
-rw-r--r-- | lib/stdlib/src/escript.erl | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/stdlib/src/escript.erl b/lib/stdlib/src/escript.erl index 2093916a7c..88c6f59b2d 100644 --- a/lib/stdlib/src/escript.erl +++ b/lib/stdlib/src/escript.erl @@ -224,8 +224,8 @@ return_sections(S, Bin) -> normalize_section(Name, undefined) -> {Name, undefined}; normalize_section(shebang, "#!" ++ Chars) -> - Chopped = string:strip(Chars, right, $\n), - Stripped = string:strip(Chopped, both), + Chopped = string:trim(Chars, trailing, "$\n"), + Stripped = string:trim(Chopped, both), if Stripped =:= ?SHEBANG -> {shebang, default}; @@ -233,8 +233,8 @@ normalize_section(shebang, "#!" ++ Chars) -> {shebang, Stripped} end; normalize_section(comment, Chars) -> - Chopped = string:strip(Chars, right, $\n), - Stripped = string:strip(string:strip(Chopped, left, $%), both), + Chopped = string:trim(Chars, trailing, "$\n"), + Stripped = string:trim(string:trim(Chopped, leading, "$%"), both), if Stripped =:= ?COMMENT -> {comment, default}; @@ -242,8 +242,8 @@ normalize_section(comment, Chars) -> {comment, Stripped} end; normalize_section(emu_args, "%%!" ++ Chars) -> - Chopped = string:strip(Chars, right, $\n), - Stripped = string:strip(Chopped, both), + Chopped = string:trim(Chars, trailing, "$\n"), + Stripped = string:trim(Chopped, both), {emu_args, Stripped}; normalize_section(Name, Chars) -> {Name, Chars}. |