it's an insertion if R_IAFTER or R_IBEFORE are set, regardless
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sat, 5 Dec 1992 06:19:52 +0000 (22:19 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sat, 5 Dec 1992 06:19:52 +0000 (22:19 -0800)
SCCS-vsn: lib/libc/db/recno/rec_put.c 5.6

usr/src/lib/libc/db/recno/rec_put.c

index 925ceac..3ad55b7 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)rec_put.c  5.5 (Berkeley) %G%";
+static char sccsid[] = "@(#)rec_put.c  5.6 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
@@ -162,7 +162,8 @@ __rec_iput(t, nrec, data, flags)
 
        /* __rec_search pins the returned page. */
        if ((e = __rec_search(t, nrec,
 
        /* __rec_search pins the returned page. */
        if ((e = __rec_search(t, nrec,
-           nrec > t->bt_nrecs ? SINSERT : SEARCH)) == NULL)
+           nrec > t->bt_nrecs || flags == R_IAFTER || flags == R_IBEFORE ?
+           SINSERT : SEARCH)) == NULL)
                return (RET_ERROR);
 
        h = e->page;
                return (RET_ERROR);
 
        h = e->page;