aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLuis Ressel <aranea@aixah.de>2019-03-11 18:14:49 +0100
committerDavid Bremner <david@tethera.net>2019-03-11 22:24:55 -0300
commit9f7e851263b96acacc9ea542e9f5d837563fea05 (patch)
treef23cc706248815e67aaf75e3a4759fbff7be22d5 /lib
parenta1e649276e181bbb2f14594628333d4337e3fc7c (diff)
Prepend regerror() messages with "regexp error: "
The exact error messages returned by regerror() aren't standardized; relying on them isn't portable. Thus, add a a prefix to make clear that the subsequent message is a regexp parsing error, and only look for this prefix in the test suite, ignoring the rest of the message.
Diffstat (limited to 'lib')
-rw-r--r--lib/regexp-fields.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/regexp-fields.cc b/lib/regexp-fields.cc
index 084bc8c0..f50da9a3 100644
--- a/lib/regexp-fields.cc
+++ b/lib/regexp-fields.cc
@@ -35,9 +35,9 @@ compile_regex (regex_t &regexp, const char *str)
if (err != 0) {
size_t len = regerror (err, &regexp, NULL, 0);
char *buffer = new char[len];
- std::string msg;
+ std::string msg = "Regexp error: ";
(void) regerror (err, &regexp, buffer, len);
- msg.assign (buffer, len);
+ msg.append (buffer, len);
delete[] buffer;
throw Xapian::QueryParserError (msg);