Fixed bug in file loading where line text would still contain line endings.

This commit is contained in:
Nathan Vegdahl 2015-01-01 13:16:33 -08:00
parent 7099e4d0d3
commit 378012d799

View File

@ -132,7 +132,8 @@ impl Line {
_ => {} _ => {}
} }
} }
else if le_size == 0 && tl.text.len() >= 2 {
if le_size == 0 && tl.text.len() >= 2 {
match unsafe{mem::transmute::<&[u8], &str>(tl.text.slice_from(text_size-2))} { match unsafe{mem::transmute::<&[u8], &str>(tl.text.slice_from(text_size-2))} {
// CRLF // CRLF
"\u{000D}\u{000A}" => { "\u{000D}\u{000A}" => {
@ -143,7 +144,8 @@ impl Line {
_ => {} _ => {}
} }
} }
else if le_size == 0 && tl.text.len() >= 1 {
if le_size == 0 && tl.text.len() >= 1 {
match unsafe{mem::transmute::<&[u8], &str>(tl.text.slice_from(text_size-1))} { match unsafe{mem::transmute::<&[u8], &str>(tl.text.slice_from(text_size-1))} {
// LF or CRLF // LF or CRLF
"\u{000A}" => { "\u{000A}" => {