Mercurial > hg > Members > kono > nitros9-code
view 3rdparty/packages/ed/del.c @ 2444:597d98fc261e
RFM: never say die
author | aaronwolfe |
---|---|
date | Fri, 26 Feb 2010 05:24:46 +0000 |
parents | bef1844de0dc |
children |
line wrap: on
line source
/* del.c */ #include <stdio.h> #include "tools.h" #include "ed.h" int del(from, to) int from, to; { LINE *first, *last, *next, *tmp; if (from < 1) from = 1; first = getptr(prevln(from)); last = getptr(nextln(to)); next = first->l_next; while (next != last && next != &line0) { tmp = next->l_next; free((char *) next); next = tmp; } relink(first, last, first, last); lastln -= (to - from) + 1; curln = prevln(from); return(0); }