* main.c (directory_history_list): Allow history command even

with just one entry - it's more intuitive.
This commit is contained in:
Pavel Roskin 2003-02-18 06:19:11 +00:00
parent 738e33006b
commit f95d276250
2 changed files with 17 additions and 17 deletions

View File

@ -1,5 +1,8 @@
2003-02-18 Pavel Roskin <proski@gnu.org>
* main.c (directory_history_list): Allow history command even
with just one entry - it's more intuitive.
* util.c (list_append_unique): New function - add text to GList
and remove duplicates.
* main.c (directory_history_add): Use list_append_unique().

View File

@ -833,24 +833,21 @@ void
directory_history_list (WPanel *panel)
{
char *s;
/* must be at least two to show a history */
if (panel->dir_history) {
if (panel->dir_history->prev || panel->dir_history->next) {
s = show_hist (panel->dir_history, panel->widget.x,
panel->widget.y);
if (s) {
int r;
r = _do_panel_cd (panel, s, cd_exact);
if (r)
if (!panel->dir_history)
return;
s = show_hist (panel->dir_history, panel->widget.x, panel->widget.y);
if (!s)
return;
if (_do_panel_cd (panel, s, cd_exact))
directory_history_add (panel, panel->cwd);
else
message (1, MSG_ERROR,
_("Cannot change directory"));
message (1, MSG_ERROR, _("Cannot change directory"));
g_free (s);
}
}
}
}
#ifdef HAVE_SUBSHELL_SUPPORT
int