summaryrefslogtreecommitdiff
path: root/include/mailutils/mailbox.h
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2016-11-14 09:34:57 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2016-11-14 15:27:44 +0200
commita04c6feb5007aeeb133b15558f13733743dee3e8 (patch)
tree0d129e951d61876540e9feed6824083327fa4e12 /include/mailutils/mailbox.h
parentaba91e51a9d91c0abef4db78ac4a52c543432bee (diff)
downloadmailutils-a04c6feb5007aeeb133b15558f13733743dee3e8.tar.gz
mailutils-a04c6feb5007aeeb133b15558f13733743dee3e8.tar.bz2
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.
Diffstat (limited to 'include/mailutils/mailbox.h')
-rw-r--r--include/mailutils/mailbox.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/mailutils/mailbox.h b/include/mailutils/mailbox.h
index 5cfb89dfd..9b9e43f56 100644
--- a/include/mailutils/mailbox.h
+++ b/include/mailutils/mailbox.h
@@ -36,6 +36,8 @@ const char *mu_mailbox_url (void);
const char *mu_folder_directory (void);
int mu_construct_user_mailbox_url (char **pout, const char *name);
+int mu_mailbox_expand_name (const char *name, char **expansion);
+
/* Constructor/destructor and possible types. */
extern int mu_mailbox_create (mu_mailbox_t *, const char *);
extern int mu_mailbox_create_from_url (mu_mailbox_t *, mu_url_t);

Return to:

Send suggestions and report system problems to the System administrator.