while(*++cp
){flagc=flagchar;
- while(*flagc && *flagc != *cp ){flagc++ OD
+ while(*flagc && *flagc != *cp ){flagc++ ;}
if (*cp == *flagc
) { flags |= flagval[flagc-flagchar];
} else if (*cp=='c' && argc>2 && comdiv==0
argp[1]=argp[0]; argp++; argc--;
} else { failed(argv[1],badopt);
;}
- OD
+ ;}
argp[1]=argp[0]; argc--;
;}
) { *flagp++ = *flagc;
;}
flagc++;
- OD
+ ;}
*flagp++=0;
return(argc);
REG STRING *argp=argi;
REG INT argn=0;
- while(Rcheat(*argp++)!=ENDARGS ){argn++ OD
+ while(Rcheat(*argp++)!=ENDARGS ){argn++ ;}
/* 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++
- ){free(*argp) OD
+ ){free(*argp) ;}
free(argblk);
;}
;}
dolv=np;
while(n--
- ){*np++ = make(*fp++) OD
+ ){*np++ = make(*fp++) ;}
*np++ = ENDARGS;
return(pp);
}
REG BLKPTR p = blokp;
REG BLKPTR q;
do { if(!busy(p)
- ) { while(!busy(q = p->word) ){p->word = q->word OD
+ ) { while(!busy(q = p->word) ){p->word = q->word ;}
if(ADR(q)-ADR(p) >= rbytes
) { blokp = BLK(ADR(p)+rbytes);
if(q > blokp
r = term(flg);
while(r && ((b=(wdval==ANDFSYM)) || wdval==ORFSYM)
){r = makelist((b ? TAND : TORF), r, term(NLFLG));
- OD
+ ;}
return(r);
}
if (flag
) { ((COMPTR)t)->comio=inout(((COMPTR)t)->comio);
;}
- OD
+ ;}
((COMPTR)t)->comtyp=TCOM;
((COMPTR)t)->comset=(ARGPTR)argset;
static int skipnl()
{
- while((reserv++, word()==NL) ){chkpr(NL) OD
+ while((reserv++, word()==NL) ){chkpr(NL) ;}
return(wdval);
}
) { REG SYSPTR sp=reserved;
while(sp->sysval
&& sp->sysval!=sym
- ){sp++ OD
+ ){sp++ ;}
prs(sp->sysnam);
} else if ( sym==EOFSYM
) { prs(endoffile);
while(iotemp>base
){ unlink(iotemp->ioname);
iotemp=iotemp->iolst;
- OD
+ ;}
}
} else if ( *cs=='/'
) { slash++;
;}
- OD
+ ;}
}
for(;;) { if (cs==s
if (gmatch(entry.d_name, cs)
) { addg(s,entry.d_name,rescan); count++;
;}
- OD
+ ;}
close(dirf);
if (rescan
while(rchain
){count += expand(rchain->argval,1);
rchain=rchain->argnxt;
- OD
+ ;}
;}
*rescan='/';
;}
REG CHAR c;
s=as;
while(c = *s
- ){*s++=(c&STRIP?c:'/') OD
+ ){*s++=(c&STRIP?c:'/') ;}
}
return(count);
}
) { if (lc<=scc && scc<=(*p++) ) { ok++ ;}
} else { if (scc==(lc=(c&STRIP)) ) { ok++ ;}
;}
- OD
+ ;}
return(0);
}
if (*p==0 ) { return(1) ;}
--s;
while(*s
- ){ if (gmatch(s++,p) ) { return(1) ;} OD
+ ){ if (gmatch(s++,p) ) { return(1) ;} ;}
return(0);
case 0:
break;
;}
*s2++=c;
- OD
+ ;}
s1=as2;
- while(*s2 = *s1++ ){s2++ OD
+ while(*s2 = *s1++ ){s2++ ;}
if (s1=as3
) { *s2++='/';
while(*s2++ = *++s1 );
) { clrsig(i);
;}
trapflg[i]=0;
- OD
+ ;}
trapnote=0;
}
exitval=savxit; exitset();
;}
;}
- OD
+ ;}
}
for (;;) {
clinep=cline; chkpr(NL);
- while((c = (nosubst ? readc() : nextc(*ends)), !eolchar(c)) ){*clinep++ = c OD
+ while((c = (nosubst ? readc() : nextc(*ends)), !eolchar(c)) ){*clinep++ = c ;}
*clinep=0;
if(eof || eq(cline,ends) ) { break ;}
*clinep++=NL;
#define UNION TYPE union
#define REG register
-#define OD ;}
#define TRUE (-1)
#define FALSE 0
REG CHAR c;
while((c=getch(endch))!=endch && c
- ){pushstak(c|quote) OD
+ ){pushstak(c|quote) ;}
zerostak();
if(c!=endch ) { error(badsub) ;}
}
) { skipto('}');
;}
}
- OD
+ ;}
if(c!=endch ) { error(badsub) ;}
}
if(bra=(c==BRACE) ) { c=readc() ;}
if(letter(c)
) { argp=(STRING)relstak();
- while(alphanum(c) ){pushstak(c); c=readc() OD
+ while(alphanum(c) ){pushstak(c); c=readc() ;}
zerostak();
n=lookup(absstak(argp)); setstak(argp);
v = n->namval; id = n->namid;
) { if(c!='+'
) { for (;;) {
while(c = *v++
- ){pushstak(c|quote); OD
+ ){pushstak(c|quote); ;}
if(dolg==0 || (++dolg>dolc)
) { break;
} else { v=dolv[dolg]; pushstak(SP|(*id=='*' ? quote : 0));
usestak();
while((d=readc())!=SQUOTE && d
- ){pushstak(d) OD
+ ){pushstak(d) ;}
{
REG STRING argc;
close(pv[OTPIPE]);
}
tdystak(savptr); staktop=movstr(savptr,stakbot);
- while(d=readc() ){pushstak(d|quote) OD
+ while(d=readc() ){pushstak(d|quote) ;}
await(0);
while(stakbot!=staktop
){ if((*--staktop&STRIP)!=NL
) { ++staktop; break;
;}
- OD
+ ;}
pop();
}
if(--count == 0
) { flush(ot); count=CPYSIZ;
;}
- OD
+ ;}
flush(ot);
pop();
}
) { return(syscan->sysval);
;}
syscan++;
- OD
+ ;}
return(0);
}
) { prs(s);
if (arg ) { blank(); } else { newline(); ;}
;}
- OD
+ ;}
}
void setname(argi, xp)
REG NAMPTR n;
if (letter(*argscan)
- ) { while(alphanum(*argscan) ){argscan++ OD
+ ) { while(alphanum(*argscan) ){argscan++ ;}
if (*argscan=='='
) { *argscan = 0;
n=lookup(argi);
while(n
){assign(n, nullstr);
if (*names ) { n=lookup(*names++); } else { n=0; ;}
- OD
+ ;}
if (eof ) { rc=1 ;}
lseek(0, (long)(f->fnxt-f->fend), 1);
} else { prev = &(nscan->namrgt);
;}
nscan = *prev;
- OD
+ ;}
/* add name node */
nscan=(NAMPTR)alloc(sizeof *nscan);
){if (!alphanum(*cp)
) { return(FALSE);
;}
- OD
+ ;}
;}
return(TRUE);
}
REG STRING *e=environ;
while(*e
- ){setname(*e++, N_ENVNAM) OD
+ ){setname(*e++, N_ENVNAM) ;}
}
static INT namec;
for (i=10000; i!=1; i/=10
){ if ((pr |= (d=a/i)) ) { *abuf++=d+'0' ;}
a %= i;
- OD
+ ;}
*abuf++=a+'0';
*abuf++=0;
}
REG CHAR c;
while((c = *cp, digit(c)) && c && r>=0
- ){ r = r*10 + c - '0'; cp++ OD
+ ){ r = r*10 + c - '0'; cp++ ;}
if (r<0 || cp==icp
) { failed(icp,badnum);
} else { return(r);
REG STRING scanp = path,
argp = locstak();
- while(*scanp && *scanp!=COLON ){*argp++ = *scanp++ OD
+ while(*scanp && *scanp!=COLON ){*argp++ = *scanp++ ;}
if(scanp!=path ) { *argp++='/' ;}
if(*scanp==COLON ) { scanp++ ;}
path=(*scanp ? scanp : 0); scanp=name;
REG INT *pw = pwlist;
while(pw <= &pwlist[pwc]
- ){*pw++ = 0 OD
+ ){*pw++ = 0 ;}
pwc=0;
}
REG INT *pw = pwlist;
if(pcsid
- ) { while(*pw ){pw++ OD
+ ) { while(*pw ){pw++ ;}
if(pwc >= MAXP-1
) { pw--;
} else { pwc++;
) { *pw=0; pwc--;
} else { pw++;
;}
- OD
+ ;}
}
if(p == -1 ) { continue ;}
) { rc = (sig ? sig|SIGFLG : w_hi);
;}
wx |= w;
- OD
+ ;}
if(wx && flags&errflg
) { exitsh(rc);
if(p=at
) { while(c = *p
- ){*p++=c&STRIP; q |= c OD
+ ){*p++=c&STRIP; q |= c ;}
;}
nosubst=q"E;
}
;}
/* Lcheat(argp) &= ~ARGMK; */
argp = (ARGPTR)(Rcheat(argp)&~ARGMK);
- OD
+ ;}
return(comargn);
}
) { break;
} else { STRING s; s=fromi[m]; fromi[m]=fromi[0]; fromi[0]=s;
;}
- OD
- OD
- OD
+ ;}
+ ;}
+ ;}
}
/* Argument list generation */
while(argp
){ count += split(macro(argp->argval));
argp=argp->argnxt;
- OD
+ ;}
;}
return(count);
}
for(;;) {
sigchk(); argp=locstak()+BYTESPERWORD;
while((c = *s++, !any(c,ifsnod.namval) && c)
- ){*argp++ = c OD
+ ){*argp++ = c ;}
if(argp==staktop+BYTESPERWORD
) { if(c
) { continue;
while(ADR(stakbsy)>ADR(x)
){free(stakbsy);
stakbsy = stakbsy->word;
- OD
+ ;}
staktop=stakbot=max(ADR(x),ADR(stakbas));
rmtemp(x);
}
){if(d==c
) { return(TRUE);
;}
- OD
+ ;}
return(FALSE);
}
){if(*s2++==0
) { return(0);
;}
- OD
+ ;}
return(*--s1 - *s2);
}
) { do { if(c==LITERAL
) { *argp++=(DQUOTE);
while((c=readc()) && c!=LITERAL
- ){*argp++=(c|QUOTE); chkpr(c) OD
+ ){*argp++=(c|QUOTE); chkpr(c) ;}
*argp++=(DQUOTE);
} else { *argp++=(c);
if(c=='=' ) { wdset |= alpha ;}
if(qotchar(c)
) { d=c;
while((*argp++=(c=nextc(d))) && c!=d
- ){chkpr(c) OD
+ ){chkpr(c) ;}
;}
;}
} while ( (c=nextc(0), !eofmeta(c)) );
if( flags&execpr
) { argn=0; prs(execpmsg);
while(com[argn]!=ENDARGS
- ){prs(com[argn++]); blank() OD
+ ){prs(com[argn++]); blank() ;}
newline();
;}
} else { ignsig(i);
;}
;}
- OD
+ ;}
} else { /* print out current traps */
INT i;
){if( trapcom[i]
) { prn(i); prs(colon); prs(trapcom[i]); newline();
;}
- OD
+ ;}
;}
break;
if( a1
) { while(*++com
- ){attrib(lookup(*com), exitval) OD
+ ){attrib(lookup(*com), exitval) ;}
} else { namscan(printflg);
;}
exitval=0;
if( execflg && (treeflgs&(FAMP|FPOU))==0
) { parent=0;
} else { while((parent=fork()) == -1
- ){sigchk(); alarm(10); pause() OD
+ ){sigchk(); alarm(10); pause() ;}
;}
if( parent
){assign(n,*args++);
execute(((FORPTR)t)->fortre,0);
if( execbrk<0 ) { execbrk=0 ;}
- OD
+ ;}
if( breakcnt ) { breakcnt-- ;}
execbrk=breakcnt; loopcnt--;
argfor=freeargs(argsav);
while(execbrk==0 && (execute(((WHPTR)t)->whtre,0)==0)==(type==TWH)
){i=execute(((WHPTR)t)->dotre,0);
if( execbrk<0 ) { execbrk=0 ;}
- OD
+ ;}
if( breakcnt ) { breakcnt-- ;}
execbrk=breakcnt; loopcnt--; exitval=i;
}
t=0; break;
} else { rex=((ARGPTR)rex)->argnxt;
;}
- OD
+ ;}
if( t ) { t=(TREPTR)((REGPTR)t)->regnxt ;}
- OD
+ ;}
}
break;
}