nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit a083d7f1e15237029c49cf19bda8835baa6961fd
parent 919df09ffa5624b83786907db9b2f0934e3f6b06
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Thu,  1 Feb 2018 21:50:13 +0100

tweaks: rename a variable to be more distinct and greppable

Diffstat:
Msrc/global.c | 4++--
Msrc/nano.c | 2+-
Msrc/proto.h | 2+-
Msrc/winio.c | 2+-
4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/global.c b/src/global.c @@ -32,8 +32,8 @@ volatile sig_atomic_t the_window_resized = FALSE; #endif #ifdef __linux__ -bool console; - /* Whether we're running on a Linux VC (TRUE) or under X (FALSE). */ +bool on_a_vt; + /* Whether we're running on a Linux VT or on something else. */ #endif bool meta_key; diff --git a/src/nano.c b/src/nano.c @@ -1994,7 +1994,7 @@ int main(int argc, char **argv) struct vt_stat dummy; /* Check whether we're running on a Linux console. */ - console = (ioctl(0, VT_GETSTATE, &dummy) == 0); + on_a_vt = (ioctl(0, VT_GETSTATE, &dummy) == 0); #endif /* Back up the terminal settings so that they can be restored. */ diff --git a/src/proto.h b/src/proto.h @@ -30,7 +30,7 @@ extern volatile sig_atomic_t the_window_resized; #endif #ifdef __linux__ -extern bool console; +extern bool on_a_vt; #endif extern bool meta_key; diff --git a/src/winio.c b/src/winio.c @@ -573,7 +573,7 @@ int parse_kbinput(WINDOW *win) * Shift/Ctrl/Alt are being held together with them. */ unsigned char modifiers = 6; - if (console && ioctl(0, TIOCLINUX, &modifiers) >= 0) { + if (on_a_vt && ioctl(0, TIOCLINUX, &modifiers) >= 0) { #ifndef NANO_TINY /* Is Shift being held? */ if (modifiers & 0x01) {