|
|
1.1 root 1: /* Copyright Bell Telephone Laboratories Whippany, N.J.
2:
3: * ***************************************************
4: * ***************************************************
5: * *** EQUIVALENT TO THE UNIX EDITOR'S '-' COMMAND ***
6: * *********** R. B. Drake WH 8C-005 X4163 ***********
7: * ************ Sun Aug 26 10:54:49 1979 *************
8: * ***************************************************
9: * ***************************************************
10: * Find the beginning of the previous line and print it
11:
12: */
13: /* "@(#) minus.c: V 1.1 12/21/80" */
14:
15: #include "bas.h"
16: minus()
17: {
18: int n,c;
19: if(expr[0] != '\0')
20: n=atoi(expr);
21: else
22: n=1;
23: while(curptr != txtbuf && n--)
24: {
25: --curptr;
26: while((c=((*--curptr)&0377)) != 0 && c < 0200) ;
27: curptr -= 2; /* decriment to beginning of line */
28: }
29: lbdptr=curptr;
30: if(fetch(-1,&lbdptr) < 0)
31: {
32: error(inst.thing.linno,0);
33: return(-1);
34: }
35: prin();
36: return(0);
37: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.