diff options
author | Kevin McCarthy <kevin@8t8.us> | 2020-03-31 15:48:00 -0700 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2020-03-31 15:48:00 -0700 |
commit | a9451f9d5fd0d47ec6c1efa4c011d5ab9f9a16f3 (patch) | |
tree | 451b7cc465c675090bdbf6c8bb5874130ca07c57 /commands.c | |
parent | b94d291f8f31246b9e909171ba8de4fa9d4ccf65 (diff) |
Convert LastSaveFolder to buffer.
Diffstat (limited to 'commands.c')
-rw-r--r-- | commands.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -59,7 +59,12 @@ static const char *ExtPagerProgress = "all"; /* The folder the user last saved to. Used by ci_save_message() */ -static char LastSaveFolder[_POSIX_PATH_MAX] = ""; +static BUFFER *LastSaveFolder = NULL; + +void mutt_commands_cleanup (void) +{ + mutt_buffer_free (&LastSaveFolder); +} static void process_protected_headers (HEADER *cur) { @@ -920,10 +925,12 @@ int mutt_save_message (HEADER *h, int delete, int decode, int decrypt) /* This is an undocumented feature of ELM pointed out to me by Felix von * Leitner <leitner@prz.fu-berlin.de> */ + if (!LastSaveFolder) + LastSaveFolder = mutt_buffer_new (); if (mutt_strcmp (mutt_b2s (buf), ".") == 0) - mutt_buffer_strcpy (buf, LastSaveFolder); + mutt_buffer_strcpy (buf, mutt_b2s (LastSaveFolder)); else - strfcpy (LastSaveFolder, mutt_b2s (buf), sizeof (LastSaveFolder)); + mutt_buffer_strcpy (LastSaveFolder, mutt_b2s (buf)); mutt_buffer_expand_path (buf); |