Mercurial > hg > Members > kono > nitros9-code
view 3rdparty/packages/ed/del.c @ 2609:9dd4f422aac7
Added NitrOS-9 ROM Kit from Cloud-9
author | Boisy Pitre <boisy.pitre@nuance.com> |
---|---|
date | Tue, 31 Jan 2012 13:57:35 -0600 |
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); }