BSD 4_4_Lite2 release
[unix-history] / usr / src / lib / libc / db / btree / bt_split.c
index 4a572c0..ebfbfd3 100644 (file)
@@ -35,7 +35,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)bt_split.c 8.3 (Berkeley) 2/21/94";
+static char sccsid[] = "@(#)bt_split.c 8.4 (Berkeley) 1/9/95";
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
@@ -668,7 +668,7 @@ bt_psplit(t, h, l, r, pskip, ilen)
                 * where we decide to try and copy too much onto the left page.
                 * Make sure that doesn't happen.
                 */
                 * where we decide to try and copy too much onto the left page.
                 * Make sure that doesn't happen.
                 */
-               if (skip <= off && used + nbytes >= full) {
+               if (skip <= off && used + nbytes >= full || nxt == top - 1) {
                        --off;
                        break;
                }
                        --off;
                        break;
                }