Re: xapian parser bug?

Olly Betts <[email protected]>
Newsgroups gmane.mail.notmuch.general,gmane.comp.search.xapian.general
Message-ID <[email protected]>
On Sun, Sep 30, 2018 at 09:05:25AM -0300, David Bremner wrote:
>             if (str.find (' ') != std::string::npos)
> 		query_str = '"' + str + '"';
> 	    else
> 		query_str = str;
> 
> 	    return parser.parse_query (query_str, NOTMUCH_QUERY_PARSER_FLAGS, term_prefix);

I wouldn't recommend trying to generate strings to feed to QueryParser
like this code seems to be doing.  QueryParser aims to parse input from
humans not machines.

As well as the case where str is an operation name, the code above looks
like it will mishandle cases where str contains a tab or double quotes.
There are likely other problem cases too.

Cheers,
    Olly
_______________________________________________
notmuch mailing list
[email protected]
https://notmuchmail.org/mailman/listinfo/notmuch
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.