summaryrefslogtreecommitdiffstats
path: root/browser.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>2001-09-11 11:20:34 +0000
committerThomas Roessler <roessler@does-not-exist.org>2001-09-11 11:20:34 +0000
commitd3e9c08abe0231ecad6740ed2722c2c8896eef42 (patch)
treecf2425738ecfc9ba9d1bb8b2abe97273bdcb8293 /browser.c
parent0dd6d28791e3018f6cc4700e26445f4382114e37 (diff)
The addressbook used to crash when someone issued the alias and
unalias commands while on that menu. This patch has a basic fix for this behaviour, and adds delete and undelete functions to this menu. While I'm on it, I've also made sure that "apply-tag" untags everything on all menus. The original crash was noted by Oliver Kauss <kauss@gmx.de>.
Diffstat (limited to 'browser.c')
-rw-r--r--browser.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/browser.c b/browser.c
index 7d259dd7..a195299d 100644
--- a/browser.c
+++ b/browser.c
@@ -507,16 +507,20 @@ static void init_menu (struct browser_state *state, MUTTMENU *menu, char *title,
menu->redraw = REDRAW_FULL;
}
-int file_tag (MUTTMENU *menu, int n)
+int file_tag (MUTTMENU *menu, int n, int m)
{
struct folder_file *ff = &(((struct folder_file *)menu->data)[n]);
+ int ot;
if (S_ISDIR (ff->mode) || (S_ISLNK (ff->mode) && link_is_dir (LastDir, ff->name)))
{
mutt_error _("Can't attach a directory!");
return 0;
}
- return ((ff->tagged = !ff->tagged) ? 1 : -1);
+ ot = ff->tagged;
+ ff->tagged = (m >= 0 ? m : !ff->tagged);
+
+ return ff->tagged - ot;
}
void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *numfiles)