Fix expansion of #, &, %, etc. in mail copy and file commands.
This was accidentally broken by commit eea2c4aa. * include/mailutils/mailbox.h (mu_mailbox_expand_name): New proto. * libmailutils/mailbox/mbx_default.c (mu_mailbox_expand_name): New function. (mu_mailbox_create_default): Use it. (mu_set_folder_directory): Accept NULL as argument. (mu_folder_directory): Reset default value after assiging it. This way the folder directory still defaults to the same value as earlier, but can be reset to NULL, if so desired. (plus_expand): Return a copy of the input string if folder is NULL. * mail/copy.c (append_to_mailbox): Use mu_mailbox_create, as the mailbox name has already been expanded. * mail/file.c (mail_expand_name): Use mu_mailbox_expand_name. (mail_file): Use mu_mailbox_create, as the mailbox name has already been expanded. * mail/mailvar.c (mailvar_cmd): New enum. (mailvar_symbol) <handler>: Change signature and return type. (mailvar_set): Rewrite. Take care not to modify the variable if the handler (if any) returns non-null or if the memory can't be allocated. (set_folder): Handler for the "folder" variable. * mail/tests/copy01.at: New testcase. * mail/tests/copy02.at: New testcase. * mail/tests/copy03.at: New testcase. * mail/tests/copy04.at: New testcase. * mail/tests/Makefile.am: Add new tests. * mail/tests/testsuite.at (MUT_MAIL_CMD): Set MAILRC to /dev/null. Add new tests.
Showing
18 changed files
with
462 additions
and
164 deletions
mail/tests/copy01.at
0 → 100644
mail/tests/copy02.at
0 → 100644
mail/tests/copy03.at
0 → 100644
mail/tests/copy04.at
0 → 100644
-
Please register or sign in to post a comment