view 3rdparty/packages/ed/doglob.c @ 2609:9dd4f422aac7

Added NitrOS-9 ROM Kit from Cloud-9
author Boisy Pitre <boisy.pitre@nuance.com>
date Tue, 31 Jan 2012 13:57:35 -0600
parents bef1844de0dc
children
line wrap: on
line source

/*      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);
}