summaryrefslogtreecommitdiffstats
path: root/src/filemanager
diff options
context:
space:
mode:
Diffstat (limited to 'src/filemanager')
-rw-r--r--src/filemanager/Makefile.am2
-rw-r--r--src/filemanager/Makefile.in5
-rw-r--r--src/filemanager/achown.c2
-rw-r--r--src/filemanager/boxes.c2
-rw-r--r--src/filemanager/cd.c2
-rw-r--r--src/filemanager/chattr.c2
-rw-r--r--src/filemanager/chmod.c2
-rw-r--r--src/filemanager/chown.c2
-rw-r--r--src/filemanager/cmd.c8
-rw-r--r--src/filemanager/cmd.h4
-rw-r--r--src/filemanager/command.c16
-rw-r--r--src/filemanager/dir.c2
-rw-r--r--src/filemanager/ext.c59
-rw-r--r--src/filemanager/file.c15
-rw-r--r--src/filemanager/filegui.c2
-rw-r--r--src/filemanager/filemanager.c12
-rw-r--r--src/filemanager/filenot.c2
-rw-r--r--src/filemanager/fileopctx.c2
-rw-r--r--src/filemanager/find.c2
-rw-r--r--src/filemanager/hotlist.c2
-rw-r--r--src/filemanager/info.c2
-rw-r--r--src/filemanager/layout.c5
-rw-r--r--src/filemanager/mountlist.c2
-rw-r--r--src/filemanager/panel.c19
-rw-r--r--src/filemanager/panelize.c2
-rw-r--r--src/filemanager/tree.c17
-rw-r--r--src/filemanager/treestore.c2
27 files changed, 113 insertions, 81 deletions
diff --git a/src/filemanager/Makefile.am b/src/filemanager/Makefile.am
index 534d8dc..0b3c365 100644
--- a/src/filemanager/Makefile.am
+++ b/src/filemanager/Makefile.am
@@ -35,6 +35,4 @@ AM_CPPFLAGS = -I$(top_srcdir) $(GLIB_CFLAGS)
if ENABLE_EXT2FS_ATTR
libmcfilemanager_la_SOURCES += \
chattr.c
-
-AM_CPPFLAGS += @EXT2FS_CFLAGS@ @E2P_CFLAGS@
endif
diff --git a/src/filemanager/Makefile.in b/src/filemanager/Makefile.in
index 2e1300b..4297fd9 100644
--- a/src/filemanager/Makefile.in
+++ b/src/filemanager/Makefile.in
@@ -91,7 +91,6 @@ host_triplet = @host@
@ENABLE_EXT2FS_ATTR_TRUE@am__append_1 = \
@ENABLE_EXT2FS_ATTR_TRUE@ chattr.c
-@ENABLE_EXT2FS_ATTR_TRUE@am__append_2 = @EXT2FS_CFLAGS@ @E2P_CFLAGS@
subdir = src/filemanager
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
@@ -138,7 +137,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4.include/vfs/mc-vfs-sfs.m4 \
$(top_srcdir)/m4.include/vfs/mc-vfs-ftp.m4 \
$(top_srcdir)/m4.include/vfs/mc-vfs-sftp.m4 \
- $(top_srcdir)/m4.include/vfs/mc-vfs-fish.m4 \
+ $(top_srcdir)/m4.include/vfs/mc-vfs-shell.m4 \
$(top_srcdir)/m4.include/vfs/mc-vfs-undelfs.m4 \
$(top_srcdir)/m4.include/vfs/mc-vfs-tarfs.m4 \
$(top_srcdir)/m4.include/vfs/mc-vfs-cpiofs.m4 \
@@ -467,7 +466,7 @@ libmcfilemanager_la_SOURCES = achown.c boxes.c boxes.h cd.c cd.h \
# Unmaintained, unsupported, etc
# listmode.c listmode.h
-AM_CPPFLAGS = -I$(top_srcdir) $(GLIB_CFLAGS) $(am__append_2)
+AM_CPPFLAGS = -I$(top_srcdir) $(GLIB_CFLAGS)
all: all-am
.SUFFIXES:
diff --git a/src/filemanager/achown.c b/src/filemanager/achown.c
index dca3eca..717a645 100644
--- a/src/filemanager/achown.c
+++ b/src/filemanager/achown.c
@@ -1,7 +1,7 @@
/*
Chown-advanced command -- for the Midnight Commander
- Copyright (C) 1994-2023
+ Copyright (C) 1994-2024
Free Software Foundation, Inc.
This file is part of the Midnight Commander.
diff --git a/src/filemanager/boxes.c b/src/filemanager/boxes.c
index e091c95..2dbc75d 100644
--- a/src/filemanager/boxes.c
+++ b/src/filemanager/boxes.c
@@ -1,7 +1,7 @@
/*
Some misc dialog boxes for the program.
- Copyright (C) 1994-2023
+ Copyright (C) 1994-2024
Free Software Foundation, Inc.
Written by:
diff --git a/src/filemanager/cd.c b/src/filemanager/cd.c
index 564a605..65b1f62 100644
--- a/src/filemanager/cd.c
+++ b/src/filemanager/cd.c
@@ -1,7 +1,7 @@
/*
cd_to() function.
- Copyright (C) 1995-2023
+ Copyright (C) 1995-2024
Free Software Foundation, Inc.
Written by:
diff --git a/src/filemanager/chattr.c b/src/filemanager/chattr.c
index 08a5a99..b5de12a 100644
--- a/src/filemanager/chattr.c
+++ b/src/filemanager/chattr.c
@@ -1,7 +1,7 @@
/*
Chattr command -- for the Midnight Commander
- Copyright (C) 2020-2023
+ Copyright (C) 2020-2024
Free Software Foundation, Inc.
Written by:
diff --git a/src/filemanager/chmod.c b/src/filemanager/chmod.c
index c93bcbc..bac3d99 100644
--- a/src/filemanager/chmod.c
+++ b/src/filemanager/chmod.c
@@ -1,7 +1,7 @@
/*
Chmod command -- for the Midnight Commander
- Copyright (C) 1994-2023
+ Copyright (C) 1994-2024
Free Software Foundation, Inc.
This file is part of the Midnight Commander.
diff --git a/src/filemanager/chown.c b/src/filemanager/chown.c
index 1ce769f..ff84a4f 100644
--- a/src/filemanager/chown.c
+++ b/src/filemanager/chown.c
@@ -1,7 +1,7 @@
/*
Chown command -- for the Midnight Commander
- Copyright (C) 1994-2023
+ Copyright (C) 1994-2024
Free Software Foundation, Inc.
This file is part of the Midnight Commander.
diff --git a/src/filemanager/cmd.c b/src/filemanager/cmd.c
index 8c33fd8..0ef7184 100644
--- a/src/filemanager/cmd.c
+++ b/src/filemanager/cmd.c
@@ -2,7 +2,7 @@
Routines invoked by a function key
They normally operate on the current panel.
- Copyright (C) 1994-2023
+ Copyright (C) 1994-2024
Free Software Foundation, Inc.
Written by:
@@ -1199,15 +1199,15 @@ sftplink_cmd (void)
/* --------------------------------------------------------------------------------------------- */
-#ifdef ENABLE_VFS_FISH
+#ifdef ENABLE_VFS_SHELL
void
-fishlink_cmd (void)
+shelllink_cmd (void)
{
nice_cd (_("Shell link to machine"), _(machine_str),
"[FIle transfer over SHell filesystem]", ":fishlink_cmd: Shell link to machine ",
"sh://", 1, TRUE);
}
-#endif /* ENABLE_VFS_FISH */
+#endif /* ENABLE_VFS_SHELL */
/* --------------------------------------------------------------------------------------------- */
diff --git a/src/filemanager/cmd.h b/src/filemanager/cmd.h
index 26bfdb7..30b309c 100644
--- a/src/filemanager/cmd.h
+++ b/src/filemanager/cmd.h
@@ -35,8 +35,8 @@ void ftplink_cmd (void);
#ifdef ENABLE_VFS_SFTP
void sftplink_cmd (void);
#endif
-#ifdef ENABLE_VFS_FISH
-void fishlink_cmd (void);
+#ifdef ENABLE_VFS_SHELL
+void shelllink_cmd (void);
#endif
void undelete_cmd (void);
void help_cmd (void);
diff --git a/src/filemanager/command.c b/src/filemanager/command.c
index 47d2d75..360f104 100644
--- a/src/filemanager/command.c
+++ b/src/filemanager/command.c
@@ -4,7 +4,7 @@
with all the magic of the command input line, we depend on some
help from the program's callback.
- Copyright (C) 1995-2023
+ Copyright (C) 1995-2024
Free Software Foundation, Inc.
Written by:
@@ -139,8 +139,11 @@ enter (WInput * lc_cmdline)
char *s;
s = expand_format (NULL, cmd[++i], TRUE);
- g_string_append (command, s);
- g_free (s);
+ if (s != NULL)
+ {
+ g_string_append (command, s);
+ g_free (s);
+ }
}
}
@@ -248,8 +251,11 @@ command_insert (WInput * in, const char *text, gboolean insert_extra_space)
char *quoted_text;
quoted_text = name_quote (text, TRUE);
- input_insert (in, quoted_text, insert_extra_space);
- g_free (quoted_text);
+ if (quoted_text != NULL)
+ {
+ input_insert (in, quoted_text, insert_extra_space);
+ g_free (quoted_text);
+ }
}
/* --------------------------------------------------------------------------------------------- */
diff --git a/src/filemanager/dir.c b/src/filemanager/dir.c
index 0931819..b405131 100644
--- a/src/filemanager/dir.c
+++ b/src/filemanager/dir.c
@@ -1,7 +1,7 @@
/*
Directory routines
- Copyright (C) 1994-2023
+ Copyright (C) 1994-2024
Free Software Foundation, Inc.
Written by:
diff --git a/src/filemanager/ext.c b/src/filemanager/ext.c
index b21c4d0..ccf5192 100644
--- a/src/filemanager/ext.c
+++ b/src/filemanager/ext.c
@@ -1,7 +1,7 @@
/*
Extension dependent execution.
- Copyright (C) 1994-2023
+ Copyright (C) 1994-2024
Free Software Foundation, Inc.
Written by:
@@ -331,15 +331,19 @@ exec_make_shell_string (const char *lc_data, const vfs_path_t * filename_vpath)
}
}
- if (!is_cd)
- g_string_append (shell_string, text);
- else
+ if (text != NULL)
{
- strcpy (pbuffer, text);
- pbuffer = strchr (pbuffer, 0);
+ if (!is_cd)
+ g_string_append (shell_string, text);
+ else
+ {
+ strcpy (pbuffer, text);
+ pbuffer = strchr (pbuffer, '\0');
+ }
+
+ g_free (text);
}
- g_free (text);
written_nonspace = TRUE;
}
}
@@ -593,12 +597,15 @@ get_popen_information (const char *cmd_file, const char *args, char *buf, int bu
static int
get_file_type_local (const vfs_path_t * filename_vpath, char *buf, int buflen)
{
- char *tmp;
- int ret;
+ char *filename_quoted;
+ int ret = 0;
- tmp = name_quote (vfs_path_get_last_path_str (filename_vpath), FALSE);
- ret = get_popen_information (FILE_CMD, tmp, buf, buflen);
- g_free (tmp);
+ filename_quoted = name_quote (vfs_path_get_last_path_str (filename_vpath), FALSE);
+ if (filename_quoted != NULL)
+ {
+ ret = get_popen_information (FILE_CMD, filename_quoted, buf, buflen);
+ g_free (filename_quoted);
+ }
return ret;
}
@@ -613,18 +620,28 @@ get_file_type_local (const vfs_path_t * filename_vpath, char *buf, int buflen)
static int
get_file_encoding_local (const vfs_path_t * filename_vpath, char *buf, int buflen)
{
- char *tmp, *lang, *args;
- int ret;
+ char *filename_quoted;
+ int ret = 0;
+
+ filename_quoted = name_quote (vfs_path_get_last_path_str (filename_vpath), FALSE);
+ if (filename_quoted != NULL)
+ {
+ char *lang;
- tmp = name_quote (vfs_path_get_last_path_str (filename_vpath), FALSE);
- lang = name_quote (autodetect_codeset, FALSE);
- args = g_strconcat (" -L", lang, " -i ", tmp, (char *) NULL);
+ lang = name_quote (autodetect_codeset, FALSE);
+ if (lang != NULL)
+ {
+ char *args;
- ret = get_popen_information ("enca", args, buf, buflen);
+ args = g_strdup_printf (" -L %s -i %s", lang, filename_quoted);
+ g_free (lang);
- g_free (args);
- g_free (lang);
- g_free (tmp);
+ ret = get_popen_information ("enca", args, buf, buflen);
+ g_free (args);
+ }
+
+ g_free (filename_quoted);
+ }
return ret;
}
diff --git a/src/filemanager/file.c b/src/filemanager/file.c
index fa2ef44..4e1f2c9 100644
--- a/src/filemanager/file.c
+++ b/src/filemanager/file.c
@@ -1,7 +1,7 @@
/*
File management.
- Copyright (C) 1994-2023
+ Copyright (C) 1994-2024
Free Software Foundation, Inc.
Written by:
@@ -1521,7 +1521,7 @@ recursive_erase (file_op_total_context_t * tctx, file_op_context_t * ctx, const
*
* ATTENTION! Be careful when modifying this function (like commit 25e419ba0886f)!
* Some implementations of readdir() in MC VFS (for example, vfs_s_readdir(), which is used
- * in FISH) don't return "." and ".." entries.
+ * in SHELL) don't return "." and ".." entries.
*/
static int
check_dir_is_empty (const vfs_path_t * vpath)
@@ -2765,9 +2765,12 @@ copy_file_file (file_op_total_context_t * tctx, file_op_context_t * ctx,
/* Query to remove short file */
if (query_dialog (Q_ ("DialogTitle|Copy"), _("Incomplete file was retrieved"),
D_ERROR, 2, _("&Delete"), _("&Keep")) == 0)
- mc_unlink (dst_vpath);
+ dst_status = DEST_SHORT_DELETE;
+ else
+ dst_status = DEST_SHORT_KEEP;
}
- else if (dst_status == DEST_SHORT_DELETE)
+
+ if (dst_status == DEST_SHORT_DELETE)
mc_unlink (dst_vpath);
else if (dst_status == DEST_FULL && !appending)
{
@@ -2812,9 +2815,11 @@ copy_file_file (file_op_total_context_t * tctx, file_op_context_t * ctx,
src_mode = 0100666 & ~src_mode;
mc_chmod (dst_vpath, (src_mode & ctx->umask_kill));
}
+ }
+ /* Always sync timestamps */
+ if (dst_status == DEST_FULL || dst_status == DEST_SHORT_KEEP)
mc_utime (dst_vpath, &times);
- }
if (return_status == FILE_CONT)
return_status = progress_update_one (tctx, ctx, file_size);
diff --git a/src/filemanager/filegui.c b/src/filemanager/filegui.c
index abca598..8e7777f 100644
--- a/src/filemanager/filegui.c
+++ b/src/filemanager/filegui.c
@@ -10,7 +10,7 @@
Janne Kukonlehto added much error recovery to them for being used
in an interactive program.
- Copyright (C) 1994-2023
+ Copyright (C) 1994-2024
Free Software Foundation, Inc.
Written by:
diff --git a/src/filemanager/filemanager.c b/src/filemanager/filemanager.c
index b995024..1250dad 100644
--- a/src/filemanager/filemanager.c
+++ b/src/filemanager/filemanager.c
@@ -1,7 +1,7 @@
/*
Main dialog (file panels) of the Midnight Commander
- Copyright (C) 1994-2023
+ Copyright (C) 1994-2024
Free Software Foundation, Inc.
Written by:
@@ -210,8 +210,8 @@ create_panel_menu (void)
#ifdef ENABLE_VFS_FTP
entries = g_list_prepend (entries, menu_entry_new (_("FT&P link..."), CK_ConnectFtp));
#endif
-#ifdef ENABLE_VFS_FISH
- entries = g_list_prepend (entries, menu_entry_new (_("S&hell link..."), CK_ConnectFish));
+#ifdef ENABLE_VFS_SHELL
+ entries = g_list_prepend (entries, menu_entry_new (_("S&hell link..."), CK_ConnectShell));
#endif
#ifdef ENABLE_VFS_SFTP
entries = g_list_prepend (entries, menu_entry_new (_("SFTP li&nk..."), CK_ConnectSftp));
@@ -1240,9 +1240,9 @@ midnight_execute_cmd (Widget * sender, long command)
case CK_Find:
find_cmd (current_panel);
break;
-#ifdef ENABLE_VFS_FISH
- case CK_ConnectFish:
- fishlink_cmd ();
+#ifdef ENABLE_VFS_SHELL
+ case CK_ConnectShell:
+ shelllink_cmd ();
break;
#endif
#ifdef ENABLE_VFS_FTP
diff --git a/src/filemanager/filenot.c b/src/filemanager/filenot.c
index 2bfc76a..0ceed42 100644
--- a/src/filemanager/filenot.c
+++ b/src/filemanager/filenot.c
@@ -3,7 +3,7 @@
tree about the changes made to the directory
structure.
- Copyright (C) 2011-2023
+ Copyright (C) 2011-2024
Free Software Foundation, Inc.
Author:
diff --git a/src/filemanager/fileopctx.c b/src/filemanager/fileopctx.c
index a118749..2da3072 100644
--- a/src/filemanager/fileopctx.c
+++ b/src/filemanager/fileopctx.c
@@ -1,7 +1,7 @@
/*
File operation contexts for the Midnight Commander
- Copyright (C) 1999-2023
+ Copyright (C) 1999-2024
Free Software Foundation, Inc.
Written by:
diff --git a/src/filemanager/find.c b/src/filemanager/find.c
index c0d2cf9..93f89b1 100644
--- a/src/filemanager/find.c
+++ b/src/filemanager/find.c
@@ -1,7 +1,7 @@
/*
Find file command for the Midnight Commander
- Copyright (C) 1995-2023
+ Copyright (C) 1995-2024
Free Software Foundation, Inc.
Written by:
diff --git a/src/filemanager/hotlist.c b/src/filemanager/hotlist.c
index fa04a3b..68406e4 100644
--- a/src/filemanager/hotlist.c
+++ b/src/filemanager/hotlist.c
@@ -1,7 +1,7 @@
/*
Directory hotlist -- for the Midnight Commander
- Copyright (C) 1994-2023
+ Copyright (C) 1994-2024
Free Software Foundation, Inc.
Written by:
diff --git a/src/filemanager/info.c b/src/filemanager/info.c
index 790f820..584bc2a 100644
--- a/src/filemanager/info.c
+++ b/src/filemanager/info.c
@@ -1,7 +1,7 @@
/*
Panel managing.
- Copyright (C) 1994-2023
+ Copyright (C) 1994-2024
Free Software Foundation, Inc.
Written by:
diff --git a/src/filemanager/layout.c b/src/filemanager/layout.c
index c9d581f..1160772 100644
--- a/src/filemanager/layout.c
+++ b/src/filemanager/layout.c
@@ -1,7 +1,7 @@
/*
Panel layout module for the Midnight Commander
- Copyright (C) 1995-2023
+ Copyright (C) 1995-2024
Free Software Foundation, Inc.
Written by:
@@ -1015,8 +1015,7 @@ setup_cmdline (void)
#ifdef ENABLE_SUBSHELL
if (mc_global.tty.use_subshell)
{
- subshell_prompt = g_string_new (tmp_prompt);
- g_free (tmp_prompt);
+ subshell_prompt = g_string_new_take (tmp_prompt);
mc_prompt = subshell_prompt->str;
}
#endif
diff --git a/src/filemanager/mountlist.c b/src/filemanager/mountlist.c
index d7fd734..bab6aa1 100644
--- a/src/filemanager/mountlist.c
+++ b/src/filemanager/mountlist.c
@@ -1,7 +1,7 @@
/*
Return a list of mounted file systems
- Copyright (C) 1991-2023
+ Copyright (C) 1991-2024
Free Software Foundation, Inc.
This file is part of the Midnight Commander.
diff --git a/src/filemanager/panel.c b/src/filemanager/panel.c
index ec1dbc3..b1174c0 100644
--- a/src/filemanager/panel.c
+++ b/src/filemanager/panel.c
@@ -1,7 +1,7 @@
/*
Panel managing.
- Copyright (C) 1994-2023
+ Copyright (C) 1994-2024
Free Software Foundation, Inc.
Written by:
@@ -2353,8 +2353,7 @@ goto_parent_dir (WPanel * panel)
mc_build_filename (vfs_path_as_str (panel->panelized_descr->root_vpath), fname->str,
(char *) NULL);
- fname = g_string_new (fname2);
- g_free (fname2);
+ fname = g_string_new_take (fname2);
}
bname = x_basename (fname->str);
@@ -2923,6 +2922,7 @@ static gboolean
do_enter_on_file_entry (WPanel * panel, file_entry_t * fe)
{
const char *fname = fe->fname->str;
+ char *fname_quoted;
vfs_path_t *full_name_vpath;
gboolean ok;
@@ -2973,12 +2973,14 @@ do_enter_on_file_entry (WPanel * panel, file_entry_t * fe)
return confirm_execute || (ret == 0);
}
+ fname_quoted = name_quote (fname, FALSE);
+ if (fname_quoted != NULL)
{
- char *tmp, *cmd;
+ char *cmd;
+
+ cmd = g_strconcat ("." PATH_SEP_STR, fname_quoted, (char *) NULL);
+ g_free (fname_quoted);
- tmp = name_quote (fname, FALSE);
- cmd = g_strconcat (".", PATH_SEP_STR, tmp, (char *) NULL);
- g_free (tmp);
shell_execute (cmd, 0);
g_free (cmd);
}
@@ -5240,8 +5242,7 @@ panel_panelize_cd (void)
tmp_vpath =
vfs_path_append_new (pdescr->root_vpath, plist->list[i].fname->str, (char *) NULL);
- list->list[i].fname = g_string_new (vfs_path_as_str (tmp_vpath));
- vfs_path_free (tmp_vpath, TRUE);
+ list->list[i].fname = g_string_new_take (vfs_path_free (tmp_vpath, FALSE));
}
list->list[i].f.link_to_dir = plist->list[i].f.link_to_dir;
list->list[i].f.stale_link = plist->list[i].f.stale_link;
diff --git a/src/filemanager/panelize.c b/src/filemanager/panelize.c
index e90076c..b1c87ca 100644
--- a/src/filemanager/panelize.c
+++ b/src/filemanager/panelize.c
@@ -1,7 +1,7 @@
/*
External panelize
- Copyright (C) 1995-2023
+ Copyright (C) 1995-2024
Free Software Foundation, Inc.
Written by:
diff --git a/src/filemanager/tree.c b/src/filemanager/tree.c
index fd50407..6f86693 100644
--- a/src/filemanager/tree.c
+++ b/src/filemanager/tree.c
@@ -6,7 +6,7 @@
created and destroyed. This is required for the future vfs layer,
it will be possible to have tree views over virtual file systems.
- Copyright (C) 1994-2023
+ Copyright (C) 1994-2024
Free Software Foundation, Inc.
Written by:
@@ -985,6 +985,16 @@ tree_toggle_navig (WTree * tree)
/* --------------------------------------------------------------------------------------------- */
+static void
+tree_help (void)
+{
+ ev_help_t event_data = { NULL, "[Directory Tree]" };
+
+ mc_event_raise (MCEVENT_GROUP_CORE, "help", &event_data);
+}
+
+/* --------------------------------------------------------------------------------------------- */
+
static cb_ret_t
tree_execute_cmd (WTree * tree, long command)
{
@@ -996,10 +1006,7 @@ tree_execute_cmd (WTree * tree, long command)
switch (command)
{
case CK_Help:
- {
- ev_help_t event_data = { NULL, "[Directory Tree]" };
- mc_event_raise (MCEVENT_GROUP_CORE, "help", &event_data);
- }
+ tree_help ();
break;
case CK_Forget:
tree_forget (tree);
diff --git a/src/filemanager/treestore.c b/src/filemanager/treestore.c
index 2d23c93..984bb92 100644
--- a/src/filemanager/treestore.c
+++ b/src/filemanager/treestore.c
@@ -8,7 +8,7 @@
created and destroyed. This is required for the future vfs layer,
it will be possible to have tree views over virtual file systems.
- Copyright (C) 1999-2023
+ Copyright (C) 1999-2024
Free Software Foundation, Inc.
Written by: