mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-01 07:04:10 +01:00
fba968dbfa
The worry here is that a binary linking with libnotmuch might lose access to Xapian::Error symbols because libnotmuch hides them. We are careful here to create ./fakedb/.notmuch in order to trigger a Xapian exception, and not just a missing file check. Thanks to jrollins and amddragon for suggestions. (cherry picked from commit 66f37f5f6864a988f94ddb893e3a176af57f6c8e)
17 lines
418 B
C++
17 lines
418 B
C++
#include <stdio.h>
|
|
#include <xapian.h>
|
|
#include <notmuch.h>
|
|
main (int argc, char **argv){
|
|
|
|
notmuch_database_t *notmuch
|
|
= notmuch_database_open ("fakedb",
|
|
NOTMUCH_DATABASE_MODE_READ_ONLY);
|
|
|
|
try{
|
|
(void)new Xapian::WritableDatabase ("./nonexistant", Xapian::DB_OPEN);
|
|
} catch (const Xapian::Error &error) {
|
|
printf("caught %s\n",error.get_msg().c_str());
|
|
return 0;
|
|
}
|
|
return 1;
|
|
}
|