Skip to content

Commit

Permalink
Merge branch '4633_cleanup'
Browse files Browse the repository at this point in the history
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
  • Loading branch information
zyv committed Mar 6, 2025
2 parents 6849d39 + 185186e commit f47634b
Show file tree
Hide file tree
Showing 117 changed files with 2,774 additions and 2,726 deletions.
3 changes: 1 addition & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,6 @@ misc/mc.menu
misc/mcedit.menu
misc/skins/Makefile
misc/ext.d/Makefile
misc/ext.d/doc.sh
misc/ext.d/misc.sh
misc/ext.d/text.sh
misc/macros.d/Makefile
Expand Down Expand Up @@ -719,7 +718,7 @@ tests/lib/widget/Makefile
tests/src/Makefile
tests/src/filemanager/Makefile
tests/src/editor/Makefile
tests/src/editor/test-data.txt
tests/src/editor/edit_complete_word_cmd_test_data.txt
tests/src/vfs/Makefile
tests/src/vfs/extfs/Makefile
tests/src/vfs/extfs/helpers-list/Makefile
Expand Down
1 change: 0 additions & 1 deletion contrib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ SCRIPTS_IN = mc.csh.in mc.sh.in mc-wrapper.csh.in mc-wrapper.sh.in
SCRIPTS_OUT = mc.csh mc.sh mc-wrapper.csh mc-wrapper.sh

pkglibexec_SCRIPTS = $(SCRIPTS_OUT)
pkglibexecdir = $(libexecdir)/@PACKAGE@

cfgdir = $(sysconfdir)/@PACKAGE@
cfg_DATA = \
Expand Down
2 changes: 1 addition & 1 deletion doc/man/date-of-man-include.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SED_PARAMETERS = \
-e "s/%MAN_VERSION%/@MAN_VERSION@/g" \
-e "s{%sysconfdir%{@sysconfdir@{g" \
-e "s{%libexecdir%{@libexecdir@{g" \
-e "s{%pkglibexecdir%{$(libexecdir)/@PACKAGE@{g" \
-e "s{%pkglibexecdir%{@pkglibexecdir@{g" \
-e "s{%pkgdatadir%{$(datadir)/@PACKAGE@{g"

MAN_DATE_CMD = \
Expand Down
4 changes: 2 additions & 2 deletions lib/charsets.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,15 @@ get_codepage_id (const int n)
int
get_codepage_index (const char *id)
{
size_t i;
guint i;

if (codepages == NULL)
return -1;
if (strcmp (id, OTHER_8BIT) == 0)
return -1;
for (i = 0; i < codepages->len; i++)
if (strcmp (id, ((codepage_desc *) g_ptr_array_index (codepages, i))->id) == 0)
return i;
return (int) i;
return -1;
}

Expand Down
1 change: 1 addition & 0 deletions lib/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
#define BUF_10K 10240L
#define BUF_8K 8192L
#define BUF_4K 4096L
#define BUF_2K 2048L
#define BUF_1K 1024L

#define BUF_LARGE BUF_1K
Expand Down
2 changes: 1 addition & 1 deletion lib/keybind.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ void
keybind_cmd_bind (GArray *keymap, const char *keybind, long action)
{
char *caption = NULL;
long key;
int key;

key = tty_keyname_to_keycode (keybind, &caption);
keymap_add (keymap, key, action, caption);
Expand Down
6 changes: 4 additions & 2 deletions lib/search/regex.c
Original file line number Diff line number Diff line change
Expand Up @@ -831,8 +831,6 @@ mc_search__run_regex (mc_search_t *lc_mc_search, const void *user_data, off_t st
{
mc_search_cbret_t ret = MC_SEARCH_CB_NOTFOUND;
off_t current_pos, virtual_pos;
gint start_pos;
gint end_pos;

if (lc_mc_search->regex_buffer != NULL)
g_string_set_size (lc_mc_search->regex_buffer, 0);
Expand Down Expand Up @@ -900,11 +898,15 @@ mc_search__run_regex (mc_search_t *lc_mc_search, const void *user_data, off_t st
switch (mc_search__regex_found_cond (lc_mc_search, lc_mc_search->regex_buffer))
{
case COND__FOUND_OK:
{
gint start_pos, end_pos;

g_match_info_fetch_pos (lc_mc_search->regex_match_info, 0, &start_pos, &end_pos);
if (found_len != NULL)
*found_len = end_pos - start_pos;
lc_mc_search->normal_offset = lc_mc_search->start_buffer + start_pos;
return TRUE;
}
case COND__NOT_ALL_FOUND:
break;
default:
Expand Down
22 changes: 7 additions & 15 deletions lib/shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,13 @@ mc_shell_get_installed_in_system (void)
static char *
mc_shell_get_name_env (void)
{
const char *shell_env;
char *shell_name = NULL;

shell_env = g_getenv ("SHELL");
const char *shell_env = g_getenv ("SHELL");
if ((shell_env == NULL) || (shell_env[0] == '\0'))
{
// 2nd choice: user login shell
struct passwd *pwd;

pwd = getpwuid (geteuid ());
const struct passwd *pwd = getpwuid (geteuid ());
if (pwd != NULL)
shell_name = g_strdup (pwd->pw_shell);
}
Expand All @@ -132,19 +129,17 @@ mc_shell_get_name_env (void)
static mc_shell_t *
mc_shell_get_from_env (void)
{
mc_shell_t *mc_shell = NULL;

char *shell_name;

shell_name = mc_shell_get_name_env ();
char *shell_name = mc_shell_get_name_env ();

if (shell_name != NULL)
{
mc_shell_t *mc_shell = NULL;
mc_shell = g_new0 (mc_shell_t, 1);
mc_shell->path = shell_name;
return mc_shell;
}

return mc_shell;
return NULL;
}

/* --------------------------------------------------------------------------------------------- */
Expand Down Expand Up @@ -263,9 +258,7 @@ mc_shell_recognize_path (mc_shell_t *mc_shell)
void
mc_shell_init (void)
{
mc_shell_t *mc_shell;

mc_shell = mc_shell_get_from_env ();
mc_shell_t *mc_shell = mc_shell_get_from_env ();

if (mc_shell == NULL)
mc_shell = mc_shell_get_installed_in_system ();
Expand All @@ -274,7 +267,6 @@ mc_shell_init (void)

/* Find out what type of shell we have. Also consider real paths (resolved symlinks)
* because e.g. csh might point to tcsh, ash to dash or busybox, sh to anything. */

if (mc_shell->real_path != NULL)
mc_shell_recognize_real_path (mc_shell);

Expand Down
4 changes: 2 additions & 2 deletions lib/tty/key.c
Original file line number Diff line number Diff line change
Expand Up @@ -1438,7 +1438,7 @@ channels_down (void)
* Return the code associated with the symbolic name keyname
*/

long
int
tty_keyname_to_keycode (const char *name, char **label)
{
char **lc_keys, **p;
Expand Down Expand Up @@ -1548,7 +1548,7 @@ tty_keyname_to_keycode (const char *name, char **label)
if (use_meta != -1)
k = ALT (k);

return (long) k;
return k;
}

/* --------------------------------------------------------------------------------------------- */
Expand Down
2 changes: 1 addition & 1 deletion lib/tty/key.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void init_key (void);
void init_key_input_fd (void);
void done_key (void);

long tty_keyname_to_keycode (const char *name, char **label);
int tty_keyname_to_keycode (const char *name, char **label);
char *tty_keycode_to_keyname (const int keycode);
/* mouse support */
int tty_get_event (struct Gpm_Event *event, gboolean redo_event, gboolean block);
Expand Down
49 changes: 31 additions & 18 deletions lib/tty/tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,37 +96,50 @@ sigintr_handler (int signo)
* @param force_xterm Set forced the XTerm type
*
* @return true if @param force_xterm is true or value of $TERM is one of following:
* term*
* konsole*
* rxvt*
* Eterm
* dtterm
* alacritty*
* contour*
* dtterm
* Eterm
* foot*
* konsole*
* rxvt*
* screen*
* term*
* tmux*
* contour*
*/
gboolean
tty_check_term (gboolean force_xterm)
tty_check_xterm_compat (const gboolean force_xterm)
{
const char *termvalue;

termvalue = getenv ("TERM");
static const char *xterm_compatible_terminals[] = {
"alacritty", //
"contour", //
"dtterm", //
"Eterm", //
"foot", //
"konsole", //
"rxvt", //
"screen", //
"tmux", //
"xterm", //
NULL,
};

const char *termvalue = getenv ("TERM");
if (termvalue == NULL || *termvalue == '\0')
{
fputs (_ ("The TERM environment variable is unset!\n"), stderr);
exit (EXIT_FAILURE);
my_exit (EXIT_FAILURE);
}

return force_xterm || strncmp (termvalue, "xterm", 5) == 0
|| strncmp (termvalue, "konsole", 7) == 0 || strncmp (termvalue, "rxvt", 4) == 0
|| strcmp (termvalue, "Eterm") == 0 || strcmp (termvalue, "dtterm") == 0
|| strncmp (termvalue, "alacritty", 9) == 0 || strncmp (termvalue, "foot", 4) == 0
|| strncmp (termvalue, "screen", 6) == 0 || strncmp (termvalue, "tmux", 4) == 0
|| strncmp (termvalue, "contour", 7) == 0;
}
if (force_xterm)
return TRUE;

for (const char **p = xterm_compatible_terminals; *p != NULL; p++)
if (strncmp (termvalue, *p, strlen (*p)) == 0)
return TRUE;

return FALSE;
}
/* --------------------------------------------------------------------------------------------- */

extern void
Expand Down
2 changes: 1 addition & 1 deletion lib/tty/tty.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ extern void tty_beep (void);

/* {{{ Input }}} */

extern gboolean tty_check_term (gboolean force_xterm);
extern gboolean tty_check_xterm_compat (gboolean force_xterm);
extern void tty_init (gboolean mouse_enable, gboolean is_xterm);
extern void tty_shutdown (void);

Expand Down
2 changes: 1 addition & 1 deletion lib/widget/wtools.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ fg_input_dialog_help (const char *header, const char *text, const char *help,
input_complete_t completion_flags)
{
char *p_text;
char histname[64] = "inp|";
char histname[BUF_TINY] = "inp|";
gboolean is_passwd = FALSE;
char *my_str = NULL;

Expand Down
3 changes: 1 addition & 2 deletions misc/ext.d/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
extdir = $(EXTHELPERSDIR)

SCRIPTS_IN = \
doc.sh.in \
misc.sh.in \
text.sh.in

SCRIPTS_OUT = \
doc.sh \
misc.sh \
text.sh

SCRIPTS_UNTOUCHED = \
archive.sh \
doc.sh \
image.sh \
package.sh \
sound.sh \
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions misc/syntax/cabal.syntax
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ context default

# links
keyword http://+ gray
keyword https://+ gray
keyword ftp://+ gray
keyword git://+ gray
keyword cvs://+ gray
Expand Down
32 changes: 15 additions & 17 deletions po/af.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Midnight Commander\n"
"Report-Msgid-Bugs-To: https://www.midnight-commander.org/\n"
"POT-Creation-Date: 2025-01-23 10:30+0100\n"
"POT-Creation-Date: 2025-03-06 20:56+0300\n"
"PO-Revision-Date: 2010-12-29 10:19+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Afrikaans (http://app.transifex.com/mc/mc/language/af/)\n"
Expand Down Expand Up @@ -1475,6 +1475,14 @@ msgstr ""
msgid "&Find all"
msgstr ""

#, c-format
msgid "Searching %s: %3d%%"
msgstr ""

#, c-format
msgid "Searching %s"
msgstr ""

msgid "Enter replacement string:"
msgstr ""

Expand All @@ -1496,14 +1504,6 @@ msgstr ""
msgid "Confirm replace"
msgstr ""

#, c-format
msgid "Searching %s: %3d%%"
msgstr ""

#, c-format
msgid "Searching %s"
msgstr ""

#, c-format
msgid "%ld replacements made"
msgstr ""
Expand Down Expand Up @@ -3751,25 +3751,23 @@ msgid "With ext2fs attributes support"
msgstr ""

#, c-format
msgid "Built with GLib %d.%d.%d\n"
msgid "Built with GLib %d.%d.%d (using GLib %u.%u.%u)\n"
msgstr ""

#, c-format
msgid "Built with S-Lang %s with terminfo database\n"
msgid "Built with S-Lang"
msgstr ""

#, c-format
msgid "Built with ncurses %s\n"
msgstr ""

msgid "Built with ncurses (unknown version)"
msgid " and terminfo database (using S-Lang %s)\n"
msgstr ""

#, c-format
msgid "Built with ncursesw %s\n"
msgid "Built with %s"
msgstr ""

msgid "Built with ncursesw (unknown version)"
#, c-format
msgid " (using %s)\n"
msgstr ""

#, c-format
Expand Down
Loading

0 comments on commit f47634b

Please sign in to comment.