summaryrefslogtreecommitdiff
blob: f081a2d28bea7276e6b5ca3215a9767bd59278db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
  First part is from http://cvsweb.se.netbsd.org/cgi-bin/bsdweb.cgi/pkgsrc/editors/nvi/patches/patch-aa?rev=1.3;content-type=text/plain

--- common/db.h	2012-08-27 06:55:01.000000000 -0400
+++ common/db.h	2012-08-27 07:17:48.000000000 -0400
@@ -16,7 +16,10 @@
     (env)->remove(env, path, NULL, flags)
 #endif
 
-#if DB_VERSION_MAJOR >= 4 && DB_VERSION_MINOR >= 1
+# if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 4) || DB_VERSION_MAJOR > 4
+#define db_open(db,file,type,flags,mode)				\
+    (db)->open(db, NULL, file, NULL, type, flags | DB_CREATE, mode)
+#elif DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1
 #define db_open(db,file,type,flags,mode)				\
     (db)->open(db, NULL, file, NULL, type, flags, mode)
 #else
--- common/msg.c
+++ common/msg.c
@@ -724,7 +724,8 @@
 		p = buf;
 	} else
 		p = file;
-	if ((sp->db_error = db_create(&db, 0, 0)) != 0 ||
+	if (access(p, R_OK) != 0 ||
+	    (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) {
 		if (first) {