Additionally always put a space between number and unit which is
required by the norms.
It is important to note that really small buffers have to be bigger than it
appears because they store bytes and non-Latin scripts need more than one byte
with UTF-8 to encode them, e.g., the string "1023 МиБ" in Russian requires
11 bytes + null terminator.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
size_trunc() has been aligned to properly use either IEC or SI prefixes with
the unit B (byte). Additionally always put a space between number and unit
which is required by the norms.
Obsolete gettext message ids have been removed and some cleaned up for
duplicate words or leading spaces.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(widget_replace): if new widget cannot take focus, move focus to other widget
before widget replacement.
In our case, the focused file panel is replaced by Info one. Info panel
a) isn't selectable (it never takes focus) and b) uses CWD of current
panel. Therefore focus must be moved to other file panel to make it
current and correctly set up it's CWD before first draw of Info panel.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Add new WDialog APIs:
* dlg_set_current_widget_next
* dlg_set_current_widget_prev
* dlg_get_widget_next_of
* dlg_get_widget_prev_of
and use them:
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Send MSG_DRAW message immediately after MSG_FOCUS/MSG_UNFOCUS.
Thus, the MSG_DRAW message handler is the only place where widget
should be drawn. Widget should not draw itself in other message
handlers.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
If menu is not active, it is not selectable also in order to disallow
select and focus the inactive menu.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
To ensure that nobody uses the 'homedir' variable in the future without
initializing it first, we make it private to the function, thereby effectively
removing it.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
We can conclude, by reading their GLib source[1], by their documentation,
and by looking at how popular programs use them[2], that the functions
g_get_user_{config,cache,data}_dir() don't return a NULL or empty string.
So the handling of this case can go.
[1] https://git.gnome.org/browse/glib/tree/glib/gutils.c
[2] E.g., google "g_get_user_data_dir".
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
glob.c:143:21: warning: implicit conversion loses integer precision: 'int' to 'char' [-Wconversion]
c = ++cnt;
~ ^~~~~
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
search.c: In function 'mc_search_set_error':
search.c:497:36: error: declaration of 'mc_search' shadows a global declaration [-Werror=shadow]
search.c:419:1: error: shadowed declaration is here [-Werror=shadow]
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
input_complete.c:383:42: error: variable 'p' may be uninitialized when used here [-Werror,-Wconditional-uninitialized]
temp = g_string_new_len (*env_p, p - *env_p);
^
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
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>