summaryrefslogtreecommitdiffstats
path: root/source/helper.c
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2016-11-26 17:18:38 +0100
committerDave Davenport <qball@gmpclient.org>2016-11-26 17:18:38 +0100
commit84f7ec2f0e2ee322c82ce2ee963a418a56c2b268 (patch)
tree051609713972bbbcd6876612fd11659b75850f7b /source/helper.c
parent4f3c7f122ef423510c0bc1399c2449215ca7a680 (diff)
Fuzzy matcher, take simple escaping into account when creating regex.
Diffstat (limited to 'source/helper.c')
-rw-r--r--source/helper.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/helper.c b/source/helper.c
index ca3e93ae..8c3d9cb7 100644
--- a/source/helper.c
+++ b/source/helper.c
@@ -181,6 +181,11 @@ static gchar *fuzzy_to_regex ( const char * input )
else {
g_string_append ( str, ".*(" );
}
+ if ( *iter == '\\' ){
+ g_string_append_c ( str, '\\');
+ iter = g_utf8_next_char ( iter );
+ if ( iter == NULL ) break;
+ }
g_string_append_unichar ( str, g_utf8_get_char ( iter ) );
g_string_append ( str, ")" );
first = 0;