diff options
author | Jani Nikula <jani@nikula.org> | 2014-02-23 18:55:22 +0200 |
---|---|---|
committer | David Bremner <david@tethera.net> | 2014-03-06 07:42:10 -0400 |
commit | e8ec38c25afefacff8c2adb6e4f9e53df9870746 (patch) | |
tree | b099b7a4deeb21db5d0a0e7e32b762fe23419352 /notmuch-insert.c | |
parent | 07dd9d53cb7d92dc42ef697edb65e4c491b65928 (diff) |
cli: make sure notmuch new and insert don't add invalid tags
Check new.tags configuration values before doing anything, and bail
out on invalid values.
Diffstat (limited to 'notmuch-insert.c')
-rw-r--r-- | notmuch-insert.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/notmuch-insert.c b/notmuch-insert.c index cd6de88f..6752fc8d 100644 --- a/notmuch-insert.c +++ b/notmuch-insert.c @@ -431,6 +431,15 @@ notmuch_insert_command (notmuch_config_t *config, int argc, char *argv[]) return EXIT_FAILURE; } for (i = 0; i < new_tags_length; i++) { + const char *error_msg; + + error_msg = illegal_tag (new_tags[i], FALSE); + if (error_msg) { + fprintf (stderr, "Error: tag '%s' in new.tags: %s\n", + new_tags[i], error_msg); + return EXIT_FAILURE; + } + if (tag_op_list_append (tag_ops, new_tags[i], FALSE)) return EXIT_FAILURE; } |