SCCS-vsn: lib/libc/db/recno/rec_put.c 5.3
*/
#if defined(LIBC_SCCS) && !defined(lint)
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)rec_put.c 5.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)rec_put.c 5.3 (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
goto einval;
nrec = t->bt_rcursor;
break;
goto einval;
nrec = t->bt_rcursor;
break;
+ if ((nrec = *(recno_t *)key->data) == 0) {
+ nrec = 1;
+ flags = R_IBEFORE;
+ }
+ break;
+ case 0:
case R_IBEFORE:
if ((nrec = *(recno_t *)key->data) == 0)
goto einval;
case R_IBEFORE:
if ((nrec = *(recno_t *)key->data) == 0)
goto einval;
- * Make sure that records up to and including the put record are already
- * in the database. If skipping records, create empty ones.
+ * Make sure that records up to and including the put record are
+ * already in the database. If skipping records, create empty ones.
*/
if (nrec > t->bt_nrecs) {
if (t->bt_irec(t, nrec) == RET_ERROR)
*/
if (nrec > t->bt_nrecs) {
if (t->bt_irec(t, nrec) == RET_ERROR)
tdata.data = NULL;
tdata.size = 0;
while (nrec > t->bt_nrecs)
tdata.data = NULL;
tdata.size = 0;
while (nrec > t->bt_nrecs)
- if (__rec_iput(t, nrec, &tdata, 0)
- != RET_SUCCESS)
+ if (__rec_iput(t,
+ nrec, &tdata, 0) != RET_SUCCESS)