summaryrefslogtreecommitdiffstats
path: root/lib/mcconfig
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:11:51 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:11:51 +0000
commita6f3675fc4e21b3f899286b9a02005368d913f74 (patch)
treec9bfa92b223783ff03b8e941c3bb0d36c68d3b5e /lib/mcconfig
parentReleasing progress-linux version 3:4.8.30-1~progress7.99u1. (diff)
downloadmc-a6f3675fc4e21b3f899286b9a02005368d913f74.tar.xz
mc-a6f3675fc4e21b3f899286b9a02005368d913f74.zip
Merging upstream version 3:4.8.31.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/mcconfig')
-rw-r--r--lib/mcconfig/Makefile.in2
-rw-r--r--lib/mcconfig/common.c2
-rw-r--r--lib/mcconfig/get.c2
-rw-r--r--lib/mcconfig/history.c38
-rw-r--r--lib/mcconfig/paths.c4
-rw-r--r--lib/mcconfig/set.c2
6 files changed, 38 insertions, 12 deletions
diff --git a/lib/mcconfig/Makefile.in b/lib/mcconfig/Makefile.in
index ae9c856..fd5aeda 100644
--- a/lib/mcconfig/Makefile.in
+++ b/lib/mcconfig/Makefile.in
@@ -134,7 +134,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 \
diff --git a/lib/mcconfig/common.c b/lib/mcconfig/common.c
index 75979be..4891a39 100644
--- a/lib/mcconfig/common.c
+++ b/lib/mcconfig/common.c
@@ -1,7 +1,7 @@
/*
Configure module 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/lib/mcconfig/get.c b/lib/mcconfig/get.c
index f8ecfb1..4793b61 100644
--- a/lib/mcconfig/get.c
+++ b/lib/mcconfig/get.c
@@ -1,7 +1,7 @@
/*
Configure module 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/lib/mcconfig/history.c b/lib/mcconfig/history.c
index bfbdf0a..57249c4 100644
--- a/lib/mcconfig/history.c
+++ b/lib/mcconfig/history.c
@@ -1,7 +1,7 @@
/*
- Widgets for the Midnight Commander
+ Configure module for the Midnight Commander
- Copyright (C) 1994-2023
+ Copyright (C) 1994-2024
Free Software Foundation, Inc.
Authors:
@@ -10,7 +10,7 @@
Jakub Jelinek, 1995
Andrej Borsenkow, 1996
Norbert Warmuth, 1997
- Andrew Borodin <aborodin@vmail.ru>, 2009-2019
+ Andrew Borodin <aborodin@vmail.ru>, 2009-2023
This file is part of the Midnight Commander.
@@ -65,7 +65,7 @@ int num_history_items_recorded = 60;
/* --------------------------------------------------------------------------------------------- */
/**
- * Load the history from the ${XDG_CACHE_HOME}/mc/history file.
+ * Load the history from the ${XDG_DATA_HOME}/mc/history file.
* It is called with the widgets history name and returns the GList list.
*/
@@ -95,6 +95,33 @@ mc_config_history_get (const char *name)
/* --------------------------------------------------------------------------------------------- */
/**
+ * Get the recent item of a history from the ${XDG_DATA_HOME}/mc/history file.
+ *
+ * TODO: get rid of load the entire history to get the only top item.
+ */
+
+char *
+mc_config_history_get_recent_item (const char *name)
+{
+ GList *history;
+ char *item = NULL;
+
+ history = mc_config_history_get (name);
+ if (history != NULL)
+ {
+ /* FIXME: can history->data be NULL? */
+ item = (char *) history->data;
+ history->data = NULL;
+ history = g_list_first (history);
+ g_list_free_full (history, g_free);
+ }
+
+ return item;
+}
+
+/* --------------------------------------------------------------------------------------------- */
+
+/**
* Load history from the mc_config
*/
GList *
@@ -177,8 +204,7 @@ mc_config_history_save (mc_config_t * cfg, const char *name, GList * h)
for (i = 0; (i < num_history_items_recorded - 1) && (h->prev != NULL); i++)
h = g_list_previous (h);
- if (name != NULL)
- mc_config_del_group (cfg, name);
+ mc_config_del_group (cfg, name);
/* create charset conversion handler to convert strings
from system codepage to UTF-8 */
diff --git a/lib/mcconfig/paths.c b/lib/mcconfig/paths.c
index 46ec14d..fbb71c3 100644
--- a/lib/mcconfig/paths.c
+++ b/lib/mcconfig/paths.c
@@ -1,7 +1,7 @@
/*
paths to configuration files
- Copyright (C) 2010-2023
+ Copyright (C) 2010-2024
Free Software Foundation, Inc.
Written by:
@@ -74,7 +74,7 @@ static const struct
/* data */
{ &mc_data_str, MC_SKINS_DIR },
- { &mc_data_str, FISH_PREFIX },
+ { &mc_data_str, VFS_SHELL_PREFIX },
{ &mc_data_str, MC_ASHRC_FILE },
{ &mc_data_str, MC_BASHRC_FILE },
{ &mc_data_str, MC_INPUTRC_FILE },
diff --git a/lib/mcconfig/set.c b/lib/mcconfig/set.c
index 961435f..ce6d887 100644
--- a/lib/mcconfig/set.c
+++ b/lib/mcconfig/set.c
@@ -1,7 +1,7 @@
/*
Configure module for the Midnight Commander
- Copyright (C) 1994-2023
+ Copyright (C) 1994-2024
Free Software Foundation, Inc.
This file is part of the Midnight Commander.