view 3rdparty/packages/ed/del.c @ 2876:1ca5c484c7a7

joydrv_6551L.asm: Remove spurious ! (OR) from expression
author Tormod Volden <debian.tormod@gmail.com>
date Sun, 24 Nov 2013 15:48:17 +0100
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);
}