[yocto] [PATCH 3/3] mc: disable Ctrl-g key and Ctrl-\ key

Mark Hatle mark.hatle at windriver.com
Fri Aug 18 10:16:17 PDT 2017


I'm fine with this.  But as a non-mc user.  I'm not entirely sure what the
missing ctl-g and ctrl-\ will affect.  But since this is only for the 'gplv2'
version which isn't as used as the main version, that should be fine.

Acked-by: Mark Hatle <mark.hatle at windriver.com>

On 8/18/17 4:29 AM, Hongxu Jia wrote:
> Since ncurses upgraded to 6.0+20170715, it compile failed
> ...
> | ../../../mc-4.7.5.2/lib/tty/tty-ncurses.c: In function 'tty_init':
> | ../../../mc-4.7.5.2/lib/tty/tty-ncurses.c:163:13: error:
> dereferencing pointer to incomplete type 'TERMINAL {aka struct term}'
> |      cur_term->Nttyb.c_cc[VINTR] = CTRL ('g');   /* ^g */
> ...
> 
> We could not backport fix from the latest master which introduce
> gplv3 contamination, but we could revert to disable Ctrl-g key
> and Ctrl-\ key
> 
> Signed-off-by: Hongxu Jia <hongxu.jia at windriver.com>
> ---
>  .../mc/0001-disable-Ctrl-g-key-and-Ctrl-key.patch  | 86 ++++++++++++++++++++++
>  recipes-extended/mc/mc_4.7.5.2.bb                  |  1 +
>  2 files changed, 87 insertions(+)
>  create mode 100644 recipes-extended/mc/mc/0001-disable-Ctrl-g-key-and-Ctrl-key.patch
> 
> diff --git a/recipes-extended/mc/mc/0001-disable-Ctrl-g-key-and-Ctrl-key.patch b/recipes-extended/mc/mc/0001-disable-Ctrl-g-key-and-Ctrl-key.patch
> new file mode 100644
> index 0000000..eddc12f
> --- /dev/null
> +++ b/recipes-extended/mc/mc/0001-disable-Ctrl-g-key-and-Ctrl-key.patch
> @@ -0,0 +1,86 @@
> +From 91a1068015a09232bacac9b86fc13b318860f44e Mon Sep 17 00:00:00 2001
> +From: Hongxu Jia <hongxu.jia at windriver.com>
> +Date: Fri, 18 Aug 2017 17:05:42 +0800
> +Subject: [PATCH] disable Ctrl-g key and Ctrl-\ key
> +
> +Since ncurses upgraded to 6.0+20170715, it compile failed
> +...
> +| ../../../mc-4.7.5.2/lib/tty/tty-ncurses.c: In function 'tty_init':
> +| ../../../mc-4.7.5.2/lib/tty/tty-ncurses.c:163:13: error:
> +dereferencing pointer to incomplete type 'TERMINAL {aka struct term}'
> +|      cur_term->Nttyb.c_cc[VINTR] = CTRL ('g');   /* ^g */
> +...
> +
> +We could not backport fix from the latest master which introduce
> +gplv3 contamination, but we could revert the following commits.
> +...
> +commit a20ebb38184e177f2ead8466f3ef1f131352aba7
> +Author: Andrew Borodin <aborodin at vmail.ru>
> +Date:   Wed Dec 23 16:18:25 2009 +0000
> +
> +    Ticket #1876: use Ctrl-g key to generate SIGINT signal.
> +
> +commit 56bf77ae57ba493126a2d1a1e0dd56eb947ccca1
> +Author: Andrew Borodin <aborodin at vmail.ru>
> +Date:   Sat Feb 6 13:07:35 2010 +0300
> +
> +    Ticket #1926: Ctrl-\ key behaviour in NCurses-based MC.
> +...
> +
> +Upstream-Status: Inappropriate [gplv2 specific]
> +https://github.com/MidnightCommander/mc.git
> +
> +Signed-off-by: Hongxu Jia <hongxu.jia at windriver.com>
> +---
> + lib/tty/tty-ncurses.c  | 6 ------
> + lib/tty/tty-slang.c    | 4 ++--
> + src/keybind-defaults.c | 1 -
> + 3 files changed, 2 insertions(+), 9 deletions(-)
> +
> +diff --git a/lib/tty/tty-ncurses.c b/lib/tty/tty-ncurses.c
> +index ab61891..6c614ac 100644
> +--- a/lib/tty/tty-ncurses.c
> ++++ b/lib/tty/tty-ncurses.c
> +@@ -159,12 +159,6 @@ tty_init (gboolean slow, gboolean ugly_lines)
> +     ESCDELAY = 200;
> + #endif /* HAVE_ESCDELAY */
> + 
> +-    /* use Ctrl-g to generate SIGINT */
> +-    cur_term->Nttyb.c_cc[VINTR] = CTRL ('g');   /* ^g */
> +-    /* disable SIGQUIT to allow use Ctrl-\ key */
> +-    cur_term->Nttyb.c_cc[VQUIT] = NULL_VALUE;
> +-    tcsetattr (cur_term->Filedes, TCSANOW, &cur_term->Nttyb);
> +-
> +     tty_start_interrupt_key ();
> + 
> +     do_enter_ca_mode ();
> +diff --git a/lib/tty/tty-slang.c b/lib/tty/tty-slang.c
> +index f42fd4a..0e92c52 100644
> +--- a/lib/tty/tty-slang.c
> ++++ b/lib/tty/tty-slang.c
> +@@ -268,8 +268,8 @@ tty_init (gboolean slow, gboolean ugly_lines)
> + 
> +     tcgetattr (fileno (stdin), &boot_mode);
> +     /* 255 = ignore abort char; XCTRL('g') for abort char = ^g */
> +-    SLang_init_tty (XCTRL ('g'), 1, 0);
> +-
> ++    /* SLang_init_tty (XCTRL ('c'), 1, 0); */
> ++    SLang_init_tty (255, 1, 0);
> +     if (ugly_lines)
> +         SLtt_Has_Alt_Charset = 0;
> + 
> +diff --git a/src/keybind-defaults.c b/src/keybind-defaults.c
> +index 28e3613..075e6b6 100644
> +--- a/src/keybind-defaults.c
> ++++ b/src/keybind-defaults.c
> +@@ -368,7 +368,6 @@ const global_keymap_t default_dialog_keymap[] = {
> +     {'\n', CK_DialogOK, "Enter"},
> +     {KEY_ENTER, CK_DialogOK, "Enter"},
> +     {ESC_CHAR, CK_DialogCancel, "Esc"},
> +-    {XCTRL ('g'), CK_DialogCancel, "C-g"},
> +     {KEY_F (10), CK_DialogCancel, "F10"},
> +     {KEY_LEFT, CK_DialogPrevItem, "Left"},
> +     {KEY_UP, CK_DialogPrevItem, "Up"},
> +-- 
> +1.8.3.1
> +
> diff --git a/recipes-extended/mc/mc_4.7.5.2.bb b/recipes-extended/mc/mc_4.7.5.2.bb
> index b38964d..ca84966 100644
> --- a/recipes-extended/mc/mc_4.7.5.2.bb
> +++ b/recipes-extended/mc/mc_4.7.5.2.bb
> @@ -10,6 +10,7 @@ PR = "r3"
>  
>  SRC_URI = "http://www.midnight-commander.org/downloads/${BPN}-${PV}.tar.bz2 \
>             file://mc-CTRL.patch \
> +           file://0001-disable-Ctrl-g-key-and-Ctrl-key.patch \
>             "
>  
>  SRC_URI[md5sum] = "bdae966244496cd4f6d282d80c9cf3c6"
> 




More information about the yocto mailing list