diff 3rdparty/packages/ed/doglob.c @ 994:bef1844de0dc

The ED editor ported from Minix
author roug
date Sun, 23 Feb 2003 21:11:37 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/3rdparty/packages/ed/doglob.c	Sun Feb 23 21:11:37 2003 +0000
@@ -0,0 +1,30 @@
+/*      doglob.c        */
+#include <stdio.h>
+#include "tools.h"
+#include "ed.h"
+
+int doglob()
+{
+  int lin, stat;
+  char *cmd;
+  LINE *ptr;
+
+  cmd = inptr;
+
+  while (1) {
+        ptr = getptr(1);
+        for (lin = 1; lin <= lastln; lin++) {
+                if (ptr->l_stat & LGLOB) break;
+                ptr = ptr->l_next;
+        }
+        if (lin > lastln) break;
+
+        ptr->l_stat &= ~LGLOB;
+        curln = lin;
+        inptr = cmd;
+        if ((stat = getlst()) < 0) return(stat);
+        if ((stat = docmd(1)) < 0) return (stat);
+  }
+  return(curln);
+}
+