Convert migrated lib.c functions to use BUFFER.

Fix mutt_getcwd() to return NULL on failure.

Change mutt_rmtree(), mutt_mkwrapdir(), safe_open(), and
safe_symlink() to use BUFFER so they don't have filename length
Relocate lib.c functions to muttlib.c to enable BUFFER use.

Relocate safe_symlink(), safe_open(), mutt_rmtree() and their
dependent functions.

This rearrangement is a bit awkward.  Another approach for the future
might be to convert lib.c into a muttlib.c aware file, and just copy
the functions pgppubring.c uses inside itself.
Increase prompt size to remove warning.
Convert change folder operations to use BUFFER.

Store the folder name inside a BUFFER and use the various BUFFER
enhanced functions.
Add mutt_buffer_enter_fname().
Convert other users of BUFFY->pathbuf to use BUFFERS.

A few functions in browser.c, buffy.c, and monitor.c were using
BUFFY->pathbuf but were potentially truncating via fixed size buffers.
Convert those to use BUFFERS too.

buffy_get() was creating epath and expanding it, apparently to match
against expanded BUFFY list entries, was wasn't using the epath.  I
believe this is a bug, and have switched the comparison to epath.
Convert BUFFER->path to a BUFFER.

Rename to BUFFER->pathbuf to make it clear the field is a BUFFER, and
to make sure to catch and review all usages.

There are still uses of pathbuf that are truncating and need to be
fixed, for example in browser.c and buffy.c.

Fix up sidebar usage in one place, that was pointing inside the
BUFFY->path with a char *.  At the same time, change their "short
folder" computation to also use a BUFFER.
Change BUFFY->realpath to be const char *.

BUFFY->path is a fixed array (which will be converted to a BUFFER in
the next commit).  This is needed to call mutt_expand_path().

However, BUFFY->realpath has no such need, and so it is a bit
wasteful (not to mention not big enough) to store as such.
Add a note about $prompt_after to the $pager documentation.
Rename mutt_buffer_rfc1524_expand_command()

Remove buffer prefix now that all callers are converted.
Convert rfc1524_expand_command() implementation to use BUFFER.

Add mutt_buffer_sanitize_filename() helper.

Add a few end-of-buffer checks while iterating over command.

Convert the parameter name, paramater value, and types to use BUFFER
instead of fixed size strings.
Convert last rfc1524_expand_command caller to use a BUFFER.
Rename mutt_buffer_adv_mktemp().

Remove buffer prefix since all callers now use this version.
Convert remaining mutt_adv_mktemp() calls to use buffer version.
c53b3669 — Fabrice Fontaine 5 days ago fix static build with idn2 and unistring

Commit 78db40f25c6479b14da5a73adf7207bfbec5ccc5 did not fix static build

AC_SEARCH_LIBS prepends the library to LIBS as a result -lunistring is
added before -lidn2. To fix static build, we must set -lunistring after


Signed-off-by: Fabrice Fontaine <>
a7e1572d — Aaron Schrab 8 days ago
Generate version string during make not configure

Switch to generating the version string during make process rather than
at configure time.  This makes it easier to keep the detailed version
string accurate when doing development which doesn't require that the
configure script be rerun.
Rename to mutt_rfc1524_expand_filename().

Now that all callers pass a BUFFER, the buffer prefix is not needed to
distinguish the parameter.
Convert mutt_expand_fmt() and rfc1524_expand_filename() to BUFFER.

These two functions were tied together and so are converted at the
same time.

Note that rfc1524_expand_filename() had an off-by-one error for the
left hand size of the name template.  It was only copying i-1 instead
of the i characters before %s.
Convert mutt_expand_file_fmt() to accept BUFFER dest parameter.

mutt_expand_fmt() will be converted in the next commit, at the same
time as rfc1524_expand_filename().
Add mutt_buffer_quote_filename().

Convert almost all the callers to use the new function.  alias.c usage
is a bit involved, so leave that for now.

Remove unneeded index while converting from mutt_quote_filename().