On Tue, May 19, 2026 at 01:56:45PM +0800, Kevin J. McCarthy wrote:
Revise it to use mutt_buffer_concat_path(), which was fixed in commit
048f4ae2.
---

Derek Martin noticed this function was using an incorrect algorithm too.

The function is only called in one place, mutt_complete() which handles
command prompt completion of path.

*** This commit, however does cause a CHANGE OF BEHAVIOR. ***

When the dir part is empty, the old algorithm concatn_path combines:
 "" + "dir" => "dir"

The new algorithm, now using mutt_buffer_concat_path, combines:
 "" + "dir" => "/dir"

To see the change in mutt, start up mutt and
 - :unset folder<enter>
 - <change-folder>
 - At the prompt: Open mailbox ('?' for list):
   =usr/
   then hit Tab twice.

Before this commit mutt will try to expand "usr" in your cwd.
After this commit mutt will try to expand "/usr".

You can also see the difference if you start mutt from your homedir, and
subsitute "usr/" for a directory in your homedir, such as "Documents/".

This is an edge case, but I wanted to bring it up for discussion before
making this change.

I've pushed this up.

--
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA

Attachment: signature.asc
Description: PGP signature

Reply via email to