Fix regression introduced in 37ffc02422.
(tty_got_winch): don't read FIFO, just check whether it os empty or not.
It can be called many times without lost of info about SIGWINCH raises.
(tty_flush_winch): read from FIFO to make it empty.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
S_Lang: pre2.3.3-8 (55f58798c267d76a1b93d0d916027b71a10ac1ee): removed
static buffers dependent upon SLTT_MAX_SCREEN_ROWS/COLS in favor of
dynamically allocated arrays.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Use pipe to collect consecutive raised SIGWINCH events.
Then handle multiple events at a time treating them
as a single one.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
How to reproduce the bug:
* compile mc with gpm support
* run the gpm daemon on the console
* login to the machine with ssh from console on another machine
* run mc
At this situation, keyboard response will be sluggish and mc will consume
CPU time when idle. The reason is that mc is trying to reopen the Gpm
connection over and over again and gpm will try to close the connection
over and over again (because the user is not on the local console).
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Found by GCC 6.2.0.
color-internal.c:186:33: error: format '%X' expects argument of type 'unsigned int', but argument 3 has type 'int' [-Werror=format=]
Signed-off-by: Andreas Mohr <and@gmx.li>
Move calls of disable_mouse() and disable_bracketed_paste()
to main() because init_mouse() and enable_bracketed_paste()
are called here.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
The code that manipulates the ncurses backend into changing
the key combination to generate SIGINT from CTRL-c to CTRL-g does
so by accessing undocumented internal ncurses data structures.
This breaks compilation with netbsd-curses[0], and could also break
when the ncurses author decides to change internal structures in a
future release.
Fix it by using a portable approach that works everywhere using libc
primitives instead.
[0] https://github.com/sabotage-linux/netbsd-curses
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Introduce -Wswitch-default check.
Some minor cosmetics.
Thanks Andreas Mohr <and at gmx dot li> for original patch.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
mc fails to build when using musl as the libc provider. This is due to
the CTRL() macro not being defined in <termios.h>. We could include
<sys/ttydefaults.h> explicitly but it's easier just to ensure CTRL is
defined.
This patch taken from the Sabotage Linux distro which fixes this. This
patch has also been tested and works with the OpenEmbedded build
system.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
The "topmiddle" and "bottommiddle" characters are defined incorrectly
in many skins. This is because the correct definition wouldn't work
with S-Lang build. The only place these characters are used is the
diffviewer if either the +/- signs or the line numbers are shown,
enabled by pressing S or L. The correct definition of these characters
currently show up as 'v' and 'w' characters.
The fix makes the diffviewer use tty_print_alt_char() as it is being used
in other parts of the code, and hence it fixes the bug.
It also fixes the skin definitions.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>