summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2022-03-05 09:12:53 -0800
committerKevin McCarthy <kevin@8t8.us>2022-03-05 09:18:30 -0800
commite65fdf56e7206984a9ee3714fd01c00762f37bf8 (patch)
treeab5a250dc87799e4efc270bd53621e9a6bf3c1cf
parentbce2c294b27808f9373afa1ada61719f57d20e59 (diff)
Fix query menu tagging behavior.
rfc822_write_address() will automatically prepend ", " to the buf parameter if it is non-empty. Since query_menu() just appended ", " to buf, the '\0' marker is at "curpos + 2", and that should be passed as the offset instead. Prior to this fix, tagging would result in two comma-space separators between each tagged entry. Since rfc822_write_address() does the work too, we could just change query_menu() to pass rfc822_write_address(buf, buflen, tmpa, 0) each time. But for a stable-branch fix I'll make the smallest change. As a note, I presume this hasn't been reported because (almost) no one uses tagging in this menu. That may be because it requires hitting <select-entry> after tagging, which is non-intuitive. I think it would be worth changing to allow tagging and then hitting <exit> too.
-rw-r--r--query.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/query.c b/query.c
index 5a5c07b0..4ac4037f 100644
--- a/query.c
+++ b/query.c
@@ -521,7 +521,7 @@ static void query_menu (char *buf, size_t buflen, QUERY *results, int retbuf)
ADDRESS *tmpa = result_to_addr (QueryTable[i].data);
mutt_addrlist_to_local (tmpa);
strcat (buf, ", "); /* __STRCAT_CHECKED__ */
- rfc822_write_address ((char *) buf + curpos + 1, buflen - curpos - 1,
+ rfc822_write_address ((char *) buf + curpos + 2, buflen - curpos - 2,
tmpa, 0);
curpos = mutt_strlen (buf);
rfc822_free_address (&tmpa);