projects
/
notmuch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bd829fd
)
string-util: Disallow empty prefixes in parse_boolean_term
author
Austin Clements
<amdragon@MIT.EDU>
Mon, 7 Jan 2013 21:20:40 +0000
(16:20 -0500)
committer
David Bremner
<bremner@debian.org>
Tue, 8 Jan 2013 00:55:21 +0000
(20:55 -0400)
Xapian doesn't consider ":abc" to be a prefixed term. This makes
parse_boolean_term similarly reject queries with an empty prefix.
util/string-util.c
patch
|
blob
|
history
diff --git
a/util/string-util.c
b/util/string-util.c
index aba9aa836e6522c7c51be56458dfee6fd48618cb..a5622d7a209dfee96b90e5e3dbd698cc455ad6df 100644
(file)
--- a/
util/string-util.c
+++ b/
util/string-util.c
@@
-127,7
+127,7
@@
parse_boolean_term (void *ctx, const char *str,
/* Parse prefix */
str = skip_space (str);
const char *pos = strchr (str, ':');
- if (! pos)
+ if (! pos
|| pos == str
)
goto FAIL;
*prefix_out = talloc_strndup (ctx, str, pos - str);
if (! *prefix_out) {