diff options
author | Fernando ApesteguĂa <fernape@FreeBSD.org> | 2020-10-07 13:46:22 +0000 |
---|---|---|
committer | Fernando ApesteguĂa <fernape@FreeBSD.org> | 2020-10-07 13:46:22 +0000 |
commit | 14f7e5c0e2589c53aedd64c9278873d87b966ef9 (patch) | |
tree | 9e67e666f39c432bdbebcee51882e49e3c00f1fa /editors/kibi/files/patch-src_unix.rs | |
parent | devel/dtool: Update to 0.10.1 (diff) |
editors/kibi: Update to 0.2.1
ChangeLog: https://github.com/ilai-deutel/kibi/releases/v0.2.1
PR: 250181
Submitted by: vulcan@wired.sh (maintainer)
Notes
Notes:
svn path=/head/; revision=551640
Diffstat (limited to 'editors/kibi/files/patch-src_unix.rs')
-rw-r--r-- | editors/kibi/files/patch-src_unix.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/editors/kibi/files/patch-src_unix.rs b/editors/kibi/files/patch-src_unix.rs index 18e8668c5e2a..4df2a2a4e848 100644 --- a/editors/kibi/files/patch-src_unix.rs +++ b/editors/kibi/files/patch-src_unix.rs @@ -1,6 +1,6 @@ ---- src/unix.rs.orig 2020-04-24 08:39:34 UTC +--- src/unix.rs.orig 2020-10-06 00:22:27 UTC +++ src/unix.rs -@@ -39,7 +39,7 @@ fn xdg_dirs(xdg_type: &str, def_home_suffix: &str, def +@@ -45,7 +45,7 @@ fn xdg_dirs(xdg_type: &str, def_home_suffix: &str, def } /// Return configuration directories for UNIX systems @@ -9,3 +9,12 @@ /// Return syntax directories for UNIX systems pub fn data_dirs() -> Vec<String> { +@@ -59,7 +59,7 @@ pub fn data_dirs() -> Vec<String> { + /// This ioctl is described here: <http://man7.org/linux/man-pages/man4/tty_ioctl.4.html> + pub fn get_window_size() -> Result<(usize, usize), Error> { + let mut maybe_ws = std::mem::MaybeUninit::<winsize>::uninit(); +- cerr(unsafe { libc::ioctl(STDOUT_FILENO, TIOCGWINSZ, maybe_ws.as_mut_ptr()) }) ++ cerr(unsafe { libc::ioctl(STDOUT_FILENO, TIOCGWINSZ.into(), maybe_ws.as_mut_ptr()) }) + .map_or(None, |_| unsafe { Some(maybe_ws.assume_init()) }) + .filter(|ws| ws.ws_col != 0 && ws.ws_row != 0) + .map_or(Err(Error::InvalidWindowSize), |ws| Ok((ws.ws_row as usize, ws.ws_col as usize))) |