From a083d7f1e15237029c49cf19bda8835baa6961fd Mon Sep 17 00:00:00 2001 From: Benno Schulenberg <bensberg@telfort.nl> Date: Thu, 1 Feb 2018 21:50:13 +0100 Subject: [PATCH] tweaks: rename a variable to be more distinct and greppable --- src/global.c | 4 ++-- src/nano.c | 2 +- src/proto.h | 2 +- src/winio.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/global.c b/src/global.c index 6d379d38..8c39dabe 100644 --- 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 index 091f774a..d76edcec 100644 --- 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 index 18995490..0145e99a 100644 --- 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 index 97373a10..5a5447ae 100644 --- 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) { -- GitLab