forked from zuberfowler/zedit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DELPROT.C
46 lines (41 loc) · 1.61 KB
/
DELPROT.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <stdlib.h>
#include "zedit.h"
void delprot(
register struct bufline *ptr,
register struct bufline **curr)
/**********************************************************************/
/* */
/* Remove editor protected informational lines, reset to initial */
/* state. */
/* */
/**********************************************************************/
/* */
/* This is ZEDIT source material. */
/* */
/* ZEDIT Source Materials are intellectual property */
/* (c) Copyright 1987,2001 by Clyde Thomas Zuber. */
/* */
/**********************************************************************/
{
register struct bufline *temp;
/* don't do first and last lines */
ptr = ptr -> next;
while (ptr -> next)
{
if (ptr -> status & ST_PROT)
{
if (ptr == *curr)
*curr = (*curr) -> prev;
ptr -> prev -> next = ptr -> next;
ptr -> next -> prev = ptr -> prev;
temp = ptr;
ptr = ptr -> next;
free(temp);
} /* end then */
else
{
ptr -> status = ST_NORM;
ptr = ptr -> next;
} /* end else */
} /* end while */
} /* end delprot */