sh: kill off DONE
authorAlan Cox <alan@linux.intel.com>
Sun, 10 May 2015 21:16:59 +0000 (22:16 +0100)
committerAlan Cox <alan@linux.intel.com>
Sun, 10 May 2015 21:16:59 +0000 (22:16 +0100)
Applications/V7/cmd/sh/args.c
Applications/V7/cmd/sh/blok.c
Applications/V7/cmd/sh/expand.c
Applications/V7/cmd/sh/mac.h
Applications/V7/cmd/sh/service.c
Applications/V7/cmd/sh/string.c
Applications/V7/cmd/sh/word.c

index ed1663f..cdb5750 100644 (file)
@@ -123,10 +123,10 @@ static STRING *   copyargs(from, n)
 clearup()
 {
        /* force `for' $* lists to go away */
-       while(argfor=freeargs(argfor) DONE
+       while(argfor=freeargs(argfor) );
 
        /* clean up io files */
-       while(pop() DONE
+       while(pop() );
 }
 
 DOLPTR useargs()
index 99a5dd6..6607504 100644 (file)
@@ -47,7 +47,7 @@ ADDRESS       alloc(nbytes)
                                ;}
                        ;}
                        q = p; p = BLK(Rcheat(p->word)&~BUSY);
-               PER     p>q || (c++)==0 DONE
+               PER     p>q || (c++)==0 );
                addblok(rbytes);
        }
 }
index af9dfea..d9c1841 100644 (file)
@@ -78,7 +78,7 @@ INT   expand(as,rflg)
                REG STRING rs; rs=cs;
 
                REP     if (*rs=='/' ) { rescan=rs; *rs=0; gchain=0 ;}
-               PER     *rs++ DONE
+               PER     *rs++ );
 
                // FIXME: readdir
                while(read(dirf, (void *)&entry, 32) == 32 && (trapnote&SIGSET) == 0
@@ -179,7 +179,7 @@ static void addg(as1,as2,as3)
        while(*s2 = *s1++ DO s2++ OD
        if (s1=as3
        ) {     *s2++='/';
-               while(*s2++ = *++s1 DONE
+               while(*s2++ = *++s1 );
        ;}
        makearg(endstak(s2));
 }
index 0b2ea33..bc7f010 100644 (file)
@@ -18,7 +18,6 @@
 #define OD     ;}
 #define REP    do{
 #define PER    }while(
-#define DONE   );
 
 #define TRUE   (-1)
 #define FALSE  0
index 0c9439c..2f13069 100644 (file)
@@ -91,7 +91,7 @@ INT   pathopen(path, name)
        REG UFD         f;
 
        REP path=catpath(path,name);
-       PER (f=open(curstak(),0))<0 && path DONE
+       PER (f=open(curstak(),0))<0 && path );
        return(f);
 }
 
@@ -107,7 +107,7 @@ STRING      catpath(path,name)
        if(scanp!=path ) { *argp++='/' ;}
        if(*scanp==COLON ) { scanp++ ;}
        path=(*scanp ? scanp : 0); scanp=name;
-       while((*argp++ = *scanp++) DONE
+       while((*argp++ = *scanp++) );
        return(path);
 }
 
@@ -124,7 +124,7 @@ void        execa(at)
        ) {     xecmsg=notfound; path=getpath(*t);
                namscan(exname);
                xecenv=sh_setenv();
-               while(path=execs(path,t) DONE
+               while(path=execs(path,t) );
                failed(*t,xecmsg);
        ;}
 }
@@ -306,7 +306,7 @@ static void gsort(from,to)
 
        if((n=to-from)<=1 ) { return ;}
 
-       for (j=1; j<=n; j*=2 DONE
+       for (j=1; j<=n; j*=2 );
 
        for (m=2*j-1; m/=2;
        DO  k=n-m;
index eb4c560..4bb0b66 100644 (file)
@@ -18,7 +18,7 @@
 STRING movstr(a,b)
        REG STRING      a, b;
 {
-       while(*b++ = *a++ DONE
+       while(*b++ = *a++ );
        return(--b);
 }
 
@@ -52,6 +52,6 @@ INT   length(as)
 {
        REG STRING s;
 
-       if(s=as ) { while(*s++ DONE ;}
+       if(s=as ) { while(*s++ ); ;}
        return(s-as);
 }
index 384bc6a..df76d5a 100644 (file)
@@ -27,7 +27,7 @@ word()
 
        wdnum=0; wdset=0;
 
-       while((c=nextc(0), space(c)) DONE
+       while((c=nextc(0), space(c)) );
        if(!eofmeta(c)
        ) {     REP     if(c==LITERAL
                        ) {     *argp++=(DQUOTE);
@@ -43,7 +43,7 @@ word()
                                        DO chkpr(c) OD
                                ;}
                        ;}
-               PER (c=nextc(0), !eofmeta(c)) DONE
+               PER (c=nextc(0), !eofmeta(c)) );
                argp=endstak(argp);
                if(!letter(((ARGPTR)argp)->argval[0]) ) { wdset=0 ;}
 
@@ -124,6 +124,6 @@ static readb()
        REG INT         len;
 
        REP     if(trapnote&SIGSET ) { newline(); sigchk() ;}
-       PER (len=read(f->fdes,f->fbuf,f->fsiz))<0 && trapnote DONE
+       PER (len=read(f->fdes,f->fbuf,f->fsiz))<0 && trapnote );
        return(len);
 }