X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=util%2Fstring-util.c;h=3e7066cd58ea191a9e647f5a0177f5547f662388;hb=de37f21e5b158625cb7714c51696aaaa8bbbd8b6;hp=9e2f728fc6750c586f3effed3ecac5673ea980e0;hpb=029790d3ff6e9fccfed2214efac777b8c438e318;p=notmuch diff --git a/util/string-util.c b/util/string-util.c index 9e2f728f..3e7066cd 100644 --- a/util/string-util.c +++ b/util/string-util.c @@ -75,10 +75,12 @@ make_boolean_term (void *ctx, const char *prefix, const char *term, int need_quoting = 0; /* Do we need quoting? To be paranoid, we quote anything - * containing a quote, even though it only matters at the + * containing a quote or '(', even though these only matter at the * beginning, and anything containing non-ASCII text. */ + if (! term[0]) + need_quoting = 1; for (in = term; *in && !need_quoting; in++) - if (is_unquoted_terminator (*in) || *in == '"' + if (is_unquoted_terminator (*in) || *in == '"' || *in == '(' || (unsigned char)*in > 127) need_quoting = 1;