Fixed coredump when issuing d$ on a blank line. Fixes bin/191.

This commit is contained in:
dg 1995-01-28 01:58:14 +00:00
parent c0c281b7e3
commit 7f0d63876d

View File

@ -119,13 +119,15 @@ delete(sp, ep, fm, tm, lmode)
GETLINE_ERR(sp, fm->lno);
return (1);
}
GET_SPACE_RET(sp, bp, blen, len);
if (fm->cno != 0)
memmove(bp, p, fm->cno);
memmove(bp + fm->cno, p + (tm->cno + 1), len - (tm->cno + 1));
if (file_sline(sp, ep, fm->lno,
bp, len - ((tm->cno - fm->cno) + 1)))
goto err;
if (len != 0) {
GET_SPACE_RET(sp, bp, blen, len);
if (fm->cno != 0)
memmove(bp, p, fm->cno);
memmove(bp + fm->cno, p + (tm->cno + 1), len - (tm->cno + 1));
if (file_sline(sp, ep, fm->lno,
bp, len - ((tm->cno - fm->cno) + 1)))
goto err;
}
goto done;
}