works -- from Rodney for 4.4BSD
SCCS-vsn: contrib/ed/d.c 5.5
SCCS-vsn: contrib/ed/e.c 5.8
-static char sccsid[] = "@(#)d.c 5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)d.c 5.5 (Berkeley) %G%";
#endif /* not lint */
#include <sys/types.h>
#endif /* not lint */
#include <sys/types.h>
/* no garbage collection done currently */
#endif
#ifdef DBI
/* no garbage collection done currently */
#endif
#ifdef DBI
+ /* garbage collection should be done iff the
+ * open was done as btree, not recno.
+ */
l_db_key.size = sizeof(recno_t);
l_db_key.data = &(l_temp2->handle);
(dbhtmp->del) (dbhtmp, &l_db_key, (u_int) 0);
l_db_key.size = sizeof(recno_t);
l_db_key.data = &(l_temp2->handle);
(dbhtmp->del) (dbhtmp, &l_db_key, (u_int) 0);
-static char sccsid[] = "@(#)e.c 5.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)e.c 5.8 (Berkeley) %G%";
#endif /* not lint */
#include <sys/types.h>
#endif /* not lint */
#include <sys/types.h>
int *errnum;
{
char *tmp_path;
int *errnum;
{
char *tmp_path;
-#ifdef DBI
- RECNOINFO l_dbaccess;
-#endif
sigspecial++;
#ifndef MEMORY
sigspecial++;
#ifndef MEMORY
file_seek = 0;
#endif
#ifdef DBI
file_seek = 0;
#endif
#ifdef DBI
-/*
- (l_dbaccess.bval) = (u_char) '\0';
- (l_dbaccess.cachesize) = 0;
- (l_dbaccess.flags) = R_NOKEY;
- (l_dbaccess.lorder) = 0;
- (l_dbaccess.reclen) = 0;
- dbhtmp = dbopen(template, O_CREAT | O_RDWR,
- S_IRUSR | S_IWUSR, (DBTYPE) DB_RECNO, &l_dbaccess);
-*/
+ /* open using btree only, recno will mess things up
+ * because of garbage collection and how recno operates
+ * with delete.
+ */
dbhtmp = dbopen(template, O_CREAT | O_RDWR,
dbhtmp = dbopen(template, O_CREAT | O_RDWR,
- S_IRUSR | S_IWUSR, (DBTYPE) DB_RECNO, NULL);
+ S_IRUSR | S_IWUSR, (DBTYPE) DB_BTREE, NULL);
if (dbhtmp == NULL) {
ed_exit(5); /* unable to create buffer */
}
if (dbhtmp == NULL) {
ed_exit(5); /* unable to create buffer */
}