X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-insert.c;fp=notmuch-insert.c;h=2590e836e3fed337838602fb474dc8b4fe435216;hp=bc96af0e881c4ec2b2dac8130bf9aea22588fb81;hb=33a170e1163b39b47deafcaef863d19c0d5d62cd;hpb=cec4a87539599e7d253b694c2a0a81de86d6eb7e diff --git a/notmuch-insert.c b/notmuch-insert.c index bc96af0e..2590e836 100644 --- a/notmuch-insert.c +++ b/notmuch-insert.c @@ -27,6 +27,7 @@ #include #include #include +#include "string-util.h" static volatile sig_atomic_t interrupted; @@ -451,7 +452,7 @@ notmuch_insert_command (notmuch_config_t *config, int argc, char *argv[]) size_t new_tags_length; tag_op_list_t *tag_ops; char *query_string = NULL; - const char *folder = NULL; + char *folder = NULL; notmuch_bool_t create_folder = FALSE; notmuch_bool_t keep = FALSE; notmuch_bool_t no_hooks = FALSE; @@ -511,6 +512,7 @@ notmuch_insert_command (notmuch_config_t *config, int argc, char *argv[]) if (folder == NULL) { maildir = db_path; } else { + strip_trailing (folder, '/'); if (! is_valid_folder_name (folder)) { fprintf (stderr, "Error: invalid folder name: '%s'\n", folder); return EXIT_FAILURE;