994
|
1 /* doglob.c */
|
|
2 #include <stdio.h>
|
|
3 #include "tools.h"
|
|
4 #include "ed.h"
|
|
5
|
|
6 int doglob()
|
|
7 {
|
|
8 int lin, stat;
|
|
9 char *cmd;
|
|
10 LINE *ptr;
|
|
11
|
|
12 cmd = inptr;
|
|
13
|
|
14 while (1) {
|
|
15 ptr = getptr(1);
|
|
16 for (lin = 1; lin <= lastln; lin++) {
|
|
17 if (ptr->l_stat & LGLOB) break;
|
|
18 ptr = ptr->l_next;
|
|
19 }
|
|
20 if (lin > lastln) break;
|
|
21
|
|
22 ptr->l_stat &= ~LGLOB;
|
|
23 curln = lin;
|
|
24 inptr = cmd;
|
|
25 if ((stat = getlst()) < 0) return(stat);
|
|
26 if ((stat = docmd(1)) < 0) return (stat);
|
|
27 }
|
|
28 return(curln);
|
|
29 }
|
|
30
|