) { cp=argp[1];
flags &= ~(execpr|readpr);
while(*++cp
- DO flagc=flagchar;
+ ){flagc=flagchar;
- while(*flagc && *flagc != *cp DO flagc++ OD
+ while(*flagc && *flagc != *cp ){flagc++ OD
if (*cp == *flagc
) { flags |= flagval[flagc-flagchar];
} else if (*cp=='c' && argc>2 && comdiv==0
flagc=flagchar;
flagp=flagadr;
while(*flagc
- DO if (flags&flagval[flagc-flagchar]
+ ){if (flags&flagval[flagc-flagchar]
) { *flagp++ = *flagc;
;}
flagc++;
REG STRING *argp=argi;
REG INT argn=0;
- while(Rcheat(*argp++)!=ENDARGS DO argn++ OD
+ while(Rcheat(*argp++)!=ENDARGS ){argn++ OD
/* free old ones unless on for loop chain */
freeargs(dolh);
) { argr = argblk->dolnxt;
if ((--argblk->doluse)==0
) { for ( argp=(STRING *)argblk->dolarg; Rcheat(*argp)!=ENDARGS; argp++
- DO free(*argp) OD
+ ){free(*argp) OD
free(argblk);
;}
;}
dolv=np;
while(n--
- DO *np++ = make(*fp++) OD
+ ){*np++ = make(*fp++) OD
*np++ = ENDARGS;
return(pp);
}
REG BLKPTR p = blokp;
REG BLKPTR q;
do { if(!busy(p)
- ) { while(!busy(q = p->word) DO p->word = q->word OD
+ ) { while(!busy(q = p->word) ){p->word = q->word OD
if(ADR(q)-ADR(p) >= rbytes
) { blokp = BLK(ADR(p)+rbytes);
if(q > blokp
r = term(flg);
while(r && ((b=(wdval==ANDFSYM)) || wdval==ORFSYM)
- DO r = makelist((b ? TAND : TORF), r, term(NLFLG));
+ ){r = makelist((b ? TAND : TORF), r, term(NLFLG));
OD
return(r);
}
((COMPTR)t)->comio=io; /*initial io chain*/
argtail = &(((COMPTR)t)->comarg);
while(wdval==0
- DO argp = wdarg;
+ ){argp = wdarg;
if (wdset && keywd
) { argp->argnxt=(ARGPTR)argset;
argset=(ARGPTR *)argp;
static int skipnl()
{
- while((reserv++, word()==NL) DO chkpr(NL) OD
+ while((reserv++, word()==NL) ){chkpr(NL) OD
return(wdval);
}
) { REG SYSPTR sp=reserved;
while(sp->sysval
&& sp->sysval!=sym
- DO sp++ OD
+ ){sp++ OD
prs(sp->sysnam);
} else if ( sym==EOFSYM
) { prs(endoffile);
IOPTR base;
{
while(iotemp>base
- DO unlink(iotemp->ioname);
+ ){ unlink(iotemp->ioname);
iotemp=iotemp->iolst;
OD
}
{
REG BOOL slash; slash=0;
while(!fngchar(*cs)
- DO if (*cs++==0
+ ){if (*cs++==0
) { if (rflg && slash ) { break; } else { return(0) ;}
} else if ( *cs=='/'
) { slash++;
// FIXME: readdir
while(read(dirf, (void *)&entry, 32) == 32 && (trapnote&SIGSET) == 0
- DO if (entry.d_ino==0 ||
+ ){if (entry.d_ino==0 ||
(*entry.d_name=='.' && *cs!='.')
) { continue;
;}
if (count
) { count=0;
while(rchain
- DO count += expand(rchain->argval,1);
+ ){count += expand(rchain->argval,1);
rchain=rchain->argnxt;
OD
;}
REG CHAR c;
s=as;
while(c = *s
- DO *s++=(c&STRIP?c:'/') OD
+ ){*s++=(c&STRIP?c:'/') OD
}
return(count);
}
{BOOL ok; INT lc;
ok=0; lc=077777;
while(c = *p++
- DO if (c==']'
+ ){if (c==']'
) { return(ok?gmatch(s,p):0);
} else if ( c==MINUS
) { if (lc<=scc && scc<=(*p++) ) { ok++ ;}
if (*p==0 ) { return(1) ;}
--s;
while(*s
- DO if (gmatch(s++,p) ) { return(1) ;} OD
+ ){ if (gmatch(s++,p) ) { return(1) ;} OD
return(0);
case 0:
s1=as1;
while(c = *s1++
- DO if ((c &= STRIP)==0
+ ){if ((c &= STRIP)==0
) { *s2++='/';
break;
;}
*s2++=c;
OD
s1=as2;
- while(*s2 = *s1++ DO s2++ OD
+ while(*s2 = *s1++ ){s2++ OD
if (s1=as3
) { *s2++='/';
while(*s2++ = *++s1 );
i=MAXTRAP;
while(i--
- DO t=trapcom[i];
+ ){ t=trapcom[i];
if(t==0 || *t
) { clrsig(i);
;}
trapnote &= ~TRAPSET;
while(--i
- DO if(trapflg[i]&TRAPSET
+ ){if(trapflg[i]&TRAPSET
) { trapflg[i] &= ~TRAPSET;
if(t=trapcom[i]
) { INT savxit=exitval;
for (;;) {
clinep=cline; chkpr(NL);
- while((c = (nosubst ? readc() : nextc(*ends)), !eolchar(c)) DO *clinep++ = c OD
+ while((c = (nosubst ? readc() : nextc(*ends)), !eolchar(c)) ){*clinep++ = c OD
*clinep=0;
if(eof || eq(cline,ends) ) { break ;}
*clinep++=NL;
#define UNION TYPE union
#define REG register
-#define DO ){
#define OD ;}
#define TRUE (-1)
REG CHAR c;
while((c=getch(endch))!=endch && c
- DO pushstak(c|quote) OD
+ ){pushstak(c|quote) OD
zerostak();
if(c!=endch ) { error(badsub) ;}
}
/* skip chars up to } */
REG CHAR c;
while((c=readc()) && c!=endch
- DO switch(c) {
+ ){ switch(c) {
case SQUOTE: skipto(SQUOTE); break;
if(bra=(c==BRACE) ) { c=readc() ;}
if(letter(c)
) { argp=(STRING)relstak();
- while(alphanum(c) DO pushstak(c); c=readc() OD
+ while(alphanum(c) ){pushstak(c); c=readc() OD
zerostak();
n=lookup(absstak(argp)); setstak(argp);
v = n->namval; id = n->namid;
) { if(c!='+'
) { for (;;) {
while(c = *v++
- DO pushstak(c|quote); OD
+ ){pushstak(c|quote); OD
if(dolg==0 || (++dolg>dolc)
) { break;
} else { v=dolv[dolg]; pushstak(SP|(*id=='*' ? quote : 0));
usestak();
while((d=readc())!=SQUOTE && d
- DO pushstak(d) OD
+ ){pushstak(d) OD
{
REG STRING argc;
close(pv[OTPIPE]);
}
tdystak(savptr); staktop=movstr(savptr,stakbot);
- while(d=readc() DO pushstak(d|quote) OD
+ while(d=readc() ){pushstak(d|quote) OD
await(0);
while(stakbot!=staktop
- DO if((*--staktop&STRIP)!=NL
+ ){ if((*--staktop&STRIP)!=NL
) { ++staktop; break;
;}
OD
push(&fb); initf(in);
/* DQUOTE used to stop it from quoting */
while(c=(getch(DQUOTE)&STRIP)
- DO pushstak(c);
+ ){pushstak(c);
if(--count == 0
) { flush(ot); count=CPYSIZ;
;}
syscan=syswds; first = *w;
while(s=syscan->sysnam
- DO if (first == *s
+ ){ if (first == *s
&& eq(w,s)
) { return(syscan->sysval);
;}
INT xp;
{
while(arg
- DO REG STRING s=mactrim(arg->argval);
+ ){REG STRING s=mactrim(arg->argval);
setname(s, xp);
arg=arg->argnxt;
if (flags&execpr
REG NAMPTR n;
if (letter(*argscan)
- ) { while(alphanum(*argscan) DO argscan++ OD
+ ) { while(alphanum(*argscan) ){argscan++ OD
if (*argscan=='='
) { *argscan = 0;
n=lookup(argi);
;}
}
while(n
- DO assign(n, nullstr);
+ ){assign(n, nullstr);
if (*names ) { n=lookup(*names++); } else { n=0; ;}
OD
) { failed(nam,notid);
;}
while(nscan
- DO if ((LR=cf(nam,nscan->namid))==0
+ ){ if ((LR=cf(nam,nscan->namid))==0
) { return(nscan);
} else if ( LR<0
) { prev = &(nscan->namlft);
if (!letter(*cp)
) { return(FALSE);
} else { while(*++cp
- DO if (!alphanum(*cp)
+ ){if (!alphanum(*cp)
) { return(FALSE);
;}
OD
REG STRING *e=environ;
while(*e
- DO setname(*e++, N_ENVNAM) OD
+ ){setname(*e++, N_ENVNAM) OD
}
static INT namec;
REG char *abuf; REG POS a, i; INT pr, d;
abuf=numbuf; pr=FALSE; a=n;
for (i=10000; i!=1; i/=10
- DO if ((pr |= (d=a/i)) ) { *abuf++=d+'0' ;}
+ ){ if ((pr |= (d=a/i)) ) { *abuf++=d+'0' ;}
a %= i;
OD
*abuf++=a+'0';
REG CHAR c;
while((c = *cp, digit(c)) && c && r>=0
- DO r = r*10 + c - '0'; cp++ OD
+ ){ r = r*10 + c - '0'; cp++ OD
if (r<0 || cp==icp
) { failed(icp,badnum);
} else { return(r);
REG STRING scanp = path,
argp = locstak();
- while(*scanp && *scanp!=COLON DO *argp++ = *scanp++ OD
+ while(*scanp && *scanp!=COLON ){*argp++ = *scanp++ OD
if(scanp!=path ) { *argp++='/' ;}
if(*scanp==COLON ) { scanp++ ;}
path=(*scanp ? scanp : 0); scanp=name;
REG INT *pw = pwlist;
while(pw <= &pwlist[pwc]
- DO *pw++ = 0 OD
+ ){*pw++ = 0 OD
pwc=0;
}
REG INT *pw = pwlist;
if(pcsid
- ) { while(*pw DO pw++ OD
+ ) { while(*pw ){pw++ OD
if(pwc >= MAXP-1
) { pw--;
} else { pwc++;
post(i);
while(pwc
- DO REG INT p;
+ ){ REG INT p;
REG INT sig;
INT w_hi;
REG INT *pw=pwlist;
p=wait(&w);
while(pw <= &pwlist[ipwc]
- DO if(*pw==p
+ ){if(*pw==p
) { *pw=0; pwc--;
} else { pw++;
;}
if(p=at
) { while(c = *p
- DO *p++=c&STRIP; q |= c OD
+ ){*p++=c&STRIP; q |= c OD
;}
nosubst=q"E;
}
comargn=(STRING *)getstak(BYTESPERWORD*argn+BYTESPERWORD); comargm = comargn += argn; *comargn = ENDARGS;
while(argp
- DO *--comargn = argp->argval;
+ ){ *--comargn = argp->argval;
if(argp = argp->argnxt
) { trim(*comargn);
;}
for (j=1; j<=n; j*=2 );
for (m=2*j-1; m/=2;
- DO k=n-m;
+ ){ k=n-m;
for (j=0; j<k; j++
- DO for (i=j; i>=0; i-=m
- DO REG STRING *fromi; fromi = &from[i];
+ ){ for (i=j; i>=0; i-=m
+ ){ REG STRING *fromi; fromi = &from[i];
if(cf(fromi[m],fromi[0])>0
) { break;
} else { STRING s; s=fromi[m]; fromi[m]=fromi[0]; fromi[0]=s;
if(c=ac
) { argp=c->comarg;
while(argp
- DO count += split(macro(argp->argval));
+ ){ count += split(macro(argp->argval));
argp=argp->argnxt;
OD
;}
for(;;) {
sigchk(); argp=locstak()+BYTESPERWORD;
while((c = *s++, !any(c,ifsnod.namval) && c)
- DO *argp++ = c OD
+ ){*argp++ = c OD
if(argp==staktop+BYTESPERWORD
) { if(c
) { continue;
{
/* try to bring stack back to x */
while(ADR(stakbsy)>ADR(x)
- DO free(stakbsy);
+ ){free(stakbsy);
stakbsy = stakbsy->word;
OD
staktop=stakbot=max(ADR(x),ADR(stakbas));
REG CHAR d;
while(d = *s++
- DO if(d==c
+ ){if(d==c
) { return(TRUE);
;}
OD
REG STRING s1, s2;
{
while(*s1++ == *s2
- DO if(*s2++==0
+ ){if(*s2++==0
) { return(0);
;}
OD
) { do { if(c==LITERAL
) { *argp++=(DQUOTE);
while((c=readc()) && c!=LITERAL
- DO *argp++=(c|QUOTE); chkpr(c) OD
+ ){*argp++=(c|QUOTE); chkpr(c) OD
*argp++=(DQUOTE);
} else { *argp++=(c);
if(c=='=' ) { wdset |= alpha ;}
if(qotchar(c)
) { d=c;
while((*argp++=(c=nextc(d))) && c!=d
- DO chkpr(c) OD
+ ){chkpr(c) OD
;}
;}
} while ( (c=nextc(0), !eofmeta(c)) );
if( flags&execpr
) { argn=0; prs(execpmsg);
while(com[argn]!=ENDARGS
- DO prs(com[argn++]); blank() OD
+ ){prs(com[argn++]); blank() OD
newline();
;}
) { ++com;
;}
while(*++com
- DO INT i;
+ ){INT i;
if( (i=stoi(*com))>=MAXTRAP || i<MINTRAP
) { failed(*com,badtrap);
} else if ( clear
INT i;
for (i=0; i<MAXTRAP; i++
- DO if( trapcom[i]
+ ){if( trapcom[i]
) { prn(i); prs(colon); prs(trapcom[i]); newline();
;}
OD
if( a1
) { while(*++com
- DO attrib(lookup(*com), exitval) OD
+ ){attrib(lookup(*com), exitval) OD
} else { namscan(printflg);
;}
exitval=0;
if( execflg && (treeflgs&(FAMP|FPOU))==0
) { parent=0;
} else { while((parent=fork()) == -1
- DO sigchk(); alarm(10); pause() OD
+ ){sigchk(); alarm(10); pause() OD
;}
if( parent
;}
loopcnt++;
while(*args!=ENDARGS && execbrk==0
- DO assign(n,*args++);
+ ){assign(n,*args++);
execute(((FORPTR)t)->fortre,0);
if( execbrk<0 ) { execbrk=0 ;}
OD
loopcnt++;
while(execbrk==0 && (execute(((WHPTR)t)->whtre,0)==0)==(type==TWH)
- DO i=execute(((WHPTR)t)->dotre,0);
+ ){i=execute(((WHPTR)t)->dotre,0);
if( execbrk<0 ) { execbrk=0 ;}
OD
if( breakcnt ) { breakcnt-- ;}
REG STRING r = mactrim(((SWPTR)t)->swarg);
t=(TREPTR)((SWPTR)t)->swlst;
while(t
- DO ARGPTR rex=((REGPTR)t)->regptr;
+ ){ARGPTR rex=((REGPTR)t)->regptr;
while(rex
- DO REG STRING s;
+ ){REG STRING s;
if( gmatch(r,s=macro(rex->argval)) || (trim(s), eq(r,s))
) { execute(((REGPTR)t)->regcom,0);
t=0; break;