Skip to content

Commit 09980d3

Browse files
committed
base64: fix build (assuming rust-lang/rust#19594 is merged)
1 parent 1f91533 commit 09980d3

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/base64/base64.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ fn decode(input: &mut Reader, ignore_garbage: bool) {
142142
fn encode(input: &mut Reader, line_wrap: uint) {
143143
let b64_conf = base64::Config {
144144
char_set: base64::Standard,
145+
newline: base64::Newline::LF,
145146
pad: true,
146147
line_length: match line_wrap {
147148
0 => None,
@@ -154,14 +155,7 @@ fn encode(input: &mut Reader, line_wrap: uint) {
154155
};
155156
let encoded = to_encode.as_slice().to_base64(b64_conf);
156157

157-
// To my knowledge, RFC 3548 does not specify which line endings to use. It
158-
// seems that rust's base64 algorithm uses CRLF as prescribed by RFC 2045.
159-
// However, since GNU base64 outputs only LF (presumably because that is
160-
// the standard UNIX line ending), we strip CRs from the output to maintain
161-
// compatibility.
162-
let output = encoded.replace("\r", "");
163-
164-
println(output.as_slice());
158+
println(encoded.as_slice());
165159
}
166160

167161
fn help(progname: &str, usage: &str) {

0 commit comments

Comments
 (0)