diff options
author | Julian Mehne <julian.mehne@posteo.de> | 2017-12-01 15:22:01 +0100 |
---|---|---|
committer | Julian Mehne <julian.mehne@posteo.de> | 2017-12-02 00:19:37 +0100 |
commit | f89555064a810ad7fcb3cbe079639ac3f83ff07c (patch) | |
tree | 0e362e56dcf164374693079234610e6c4106f50b /alot/addressbook | |
parent | 054d2a932e7cb8d18dae258750ed26fb86e650b9 (diff) |
Allow regex special characters in tagstrings.
Fixes the following crashes:
1. tag completion with regex special chars
:search tag:[<tab>
2. Changing tag representation of an (existing) tag with regex special
chars:
[tags]
[[my**tag]]
normal = '','', 'white','light red', 'white','#d66'
3. Contact completion with regex special chars and no external command:
To:**foo<tab>
Diffstat (limited to 'alot/addressbook')
-rw-r--r-- | alot/addressbook/__init__.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/alot/addressbook/__init__.py b/alot/addressbook/__init__.py index 17800b33..28c4ecc7 100644 --- a/alot/addressbook/__init__.py +++ b/alot/addressbook/__init__.py @@ -34,7 +34,7 @@ class AddressBook(object): def lookup(self, query=''): """looks up all contacts where name or address match query""" res = [] - query = re.compile('.*%s.*' % query, self.reflags) + query = re.compile('.*%s.*' % re.escape(query), self.reflags) for name, email in self.get_contacts(): if query.match(name) or query.match(email): res.append((name, email)) |