Skip to content

Instantly share code, notes, and snippets.

@nijikon
Last active December 27, 2015 19:55
Show Gist options
  • Save nijikon/c77bd170ff76dfe6cea4 to your computer and use it in GitHub Desktop.
Save nijikon/c77bd170ff76dfe6cea4 to your computer and use it in GitHub Desktop.
nvi-db4.patch
--- a/common/msg.c.orig 2015-12-27 20:53:11.000000000 +0100
+++ a/common/msg.c 2015-12-27 20:54:26.000000000 +0100
@@ -724,9 +724,18 @@
p = buf;
} else
p = file;
+ if (access(p, F_OK) != 0) {
+ if (first) {
+ first = 0;
+ return (1);
+ }
+ sp->db_error = ENOENT;
+ msgq_str(sp, M_DBERR, p, "%s");
+ return (1);
+ }
if ((sp->db_error = db_create(&db, 0, 0)) != 0 ||
(sp->db_error = db->set_re_source(db, p)) != 0 ||
- (sp->db_error = db_open(db, NULL, DB_RECNO, 0, 0)) != 0) {
+ (sp->db_error = db_open(db, NULL, DB_RECNO, DB_CREATE, 0)) != 0) {
if (first) {
first = 0;
return (1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment