int log_line(SCR *sp, db_recno_t lno, u_int action) { DBT data, key; EXF *ep; size_t len; CHAR_T *lp; db_recno_t lcur; ep = sp->ep; if (F_ISSET(ep, F_NOLOG)) return (0); /* * XXX * * Kluge for vi. Clear the EXF undo flag so that the * next 'u' command does a roll-back, regardless. */ F_CLR(ep, F_UNDO); /* Put out one initial cursor record per set of changes. */ if (ep->l_cursor.lno != OOBLNO) { if (log_cursor1(sp, LOG_CURSOR_INIT)) return (1); ep->l_cursor.lno = OOBLNO; ep->l_win = sp->wp; } /*else if (ep->l_win != sp->wp) { printf("log_line own: %p, this: %p\n", ep->l_win, sp->wp); return 1; }*/ switch (action) { /* newly added for DB4 logging */ case LOG_LINE_APPEND_B: case LOG_LINE_DELETE_F: return 0; } /* * Put out the changes. If it's a LOG_LINE_RESET_B call, it's a * special case, avoid the caches. Also, if it fails and it's * line 1, it just means that the user started with an empty file, * so fake an empty length line. */ if (action == LOG_LINE_RESET_B) { if (db_get(sp, lno, DBG_NOCACHE, &lp, &len)) { static CHAR_T nul = 0; if (lno != 1) { db_err(sp, lno); return (1); } len = 0; lp = &nul; } } else if (db_get(sp, lno, DBG_FATAL, &lp, &len)) return (1); BINC_RETC(sp, sp->wp->l_lp, sp->wp->l_len, len * sizeof(CHAR_T) + CHAR_T_OFFSET); //// <-- HERE sp->wp->l_lp[0] = action; memmove(sp->wp->l_lp + sizeof(u_char), &lno, sizeof(db_recno_t)); MEMMOVEW(sp->wp->l_lp + CHAR_T_OFFSET, lp, len); /public/src.git/external/bsd/nvi/dist/common/log1.c:301:2: runtime error: member access within null pointer of type 'log_t'