annotate 3rdparty/packages/ed/doglob.c @ 3215:195c09cade21

Updated MMC Driver makefile so it will have place holders for dsk, dskclean, and dskcopy so that make does not error out when chaining into the driver tree to build disk images where applicable.
author David Ladd <drencor-xeen@users.sourceforge.net>
date Wed, 20 Dec 2017 16:07:36 -0600
parents bef1844de0dc
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
994
bef1844de0dc The ED editor ported from Minix
roug
parents:
diff changeset
1 /* doglob.c */
bef1844de0dc The ED editor ported from Minix
roug
parents:
diff changeset
2 #include <stdio.h>
bef1844de0dc The ED editor ported from Minix
roug
parents:
diff changeset
3 #include "tools.h"
bef1844de0dc The ED editor ported from Minix
roug
parents:
diff changeset
4 #include "ed.h"
bef1844de0dc The ED editor ported from Minix
roug
parents:
diff changeset
5
bef1844de0dc The ED editor ported from Minix
roug
parents:
diff changeset
6 int doglob()
bef1844de0dc The ED editor ported from Minix
roug
parents:
diff changeset
7 {
bef1844de0dc The ED editor ported from Minix
roug
parents:
diff changeset
8 int lin, stat;
bef1844de0dc The ED editor ported from Minix
roug
parents:
diff changeset
9 char *cmd;
bef1844de0dc The ED editor ported from Minix
roug
parents:
diff changeset
10 LINE *ptr;
bef1844de0dc The ED editor ported from Minix
roug
parents:
diff changeset
11
bef1844de0dc The ED editor ported from Minix
roug
parents:
diff changeset
12 cmd = inptr;
bef1844de0dc The ED editor ported from Minix
roug
parents:
diff changeset
13
bef1844de0dc The ED editor ported from Minix
roug
parents:
diff changeset
14 while (1) {
bef1844de0dc The ED editor ported from Minix
roug
parents:
diff changeset
15 ptr = getptr(1);
bef1844de0dc The ED editor ported from Minix
roug
parents:
diff changeset
16 for (lin = 1; lin <= lastln; lin++) {
bef1844de0dc The ED editor ported from Minix
roug
parents:
diff changeset
17 if (ptr->l_stat & LGLOB) break;
bef1844de0dc The ED editor ported from Minix
roug
parents:
diff changeset
18 ptr = ptr->l_next;
bef1844de0dc The ED editor ported from Minix
roug
parents:
diff changeset
19 }
bef1844de0dc The ED editor ported from Minix
roug
parents:
diff changeset
20 if (lin > lastln) break;
bef1844de0dc The ED editor ported from Minix
roug
parents:
diff changeset
21
bef1844de0dc The ED editor ported from Minix
roug
parents:
diff changeset
22 ptr->l_stat &= ~LGLOB;
bef1844de0dc The ED editor ported from Minix
roug
parents:
diff changeset
23 curln = lin;
bef1844de0dc The ED editor ported from Minix
roug
parents:
diff changeset
24 inptr = cmd;
bef1844de0dc The ED editor ported from Minix
roug
parents:
diff changeset
25 if ((stat = getlst()) < 0) return(stat);
bef1844de0dc The ED editor ported from Minix
roug
parents:
diff changeset
26 if ((stat = docmd(1)) < 0) return (stat);
bef1844de0dc The ED editor ported from Minix
roug
parents:
diff changeset
27 }
bef1844de0dc The ED editor ported from Minix
roug
parents:
diff changeset
28 return(curln);
bef1844de0dc The ED editor ported from Minix
roug
parents:
diff changeset
29 }
bef1844de0dc The ED editor ported from Minix
roug
parents:
diff changeset
30