Merge branch 'master' of github.com:Ticki/libterm
This commit is contained in:
commit
899cb89139
|
@ -4,3 +4,4 @@ version = "0.1.0"
|
||||||
authors = ["Ticki <Ticki@users.noreply.github.com>"]
|
authors = ["Ticki <Ticki@users.noreply.github.com>"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
libc = "0.2.8"
|
||||||
|
|
|
@ -15,12 +15,12 @@ impl<R: Read> ReadExt for R {
|
||||||
let _raw = try!(writer.into_raw_mode());
|
let _raw = try!(writer.into_raw_mode());
|
||||||
let mut string = String::with_capacity(30);
|
let mut string = String::with_capacity(30);
|
||||||
|
|
||||||
for c in self.chars() {
|
for c in self.bytes() {
|
||||||
match c {
|
match c {
|
||||||
Err(_) => return Err(TerminalError::StdinError),
|
Err(_) => return Err(TerminalError::StdinError),
|
||||||
Ok('\0') | Ok('\x03') | Ok('\x04') => return Ok(None),
|
Ok(b'\0') | Ok(b'\x03') | Ok(b'\x04') => return Ok(None),
|
||||||
Ok('\n') | Ok('\r') => return Ok(Some(string)),
|
Ok(b'\n') | Ok(b'\r') => return Ok(Some(string)),
|
||||||
Ok(c) => string.push(c),
|
Ok(c) => string.push(c as char),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,3 @@
|
||||||
#![feature(io)]
|
|
||||||
#![feature(libc)]
|
|
||||||
|
|
||||||
#[warn(missing_docs)]
|
#[warn(missing_docs)]
|
||||||
|
|
||||||
#[cfg(not(target_os = "redox"))]
|
#[cfg(not(target_os = "redox"))]
|
||||||
|
|
Loading…
Reference in New Issue