From 5ae02fd2c9acbb0eb5d6b9b65885a82e22ffb2b3 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 26 Sep 2023 11:27:13 -0700 Subject: [PATCH] Actually add 1990/tbr/tbr.alt.c to repo --- 1990/tbr/tbr.alt.c | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 1990/tbr/tbr.alt.c diff --git a/1990/tbr/tbr.alt.c b/1990/tbr/tbr.alt.c new file mode 100644 index 000000000..61abc189d --- /dev/null +++ b/1990/tbr/tbr.alt.c @@ -0,0 +1,11 @@ +#define D ,close( +char*c,q[512],m[256],*v[99],**u,*i[3];int f[2],p;main(){for(m[m[60]=m[62]= +32]=m[*m=124[m]=9]=6;e(-8),gets(1+(c=q))||(exit(0),0);r(0,0))for(;*++c;);} +r(t,o){*i=i[2]=0;for(u=v+98;m[*--c]^9;m[*c]&32?i[*c&2]= +*u,u-v^98&&++u:3)if(!m[*c]){for(*++c=0;!m[*--c];);*--u= +++c;}u-v^98?strcmp(*u,"cd")?*c?pipe(f),o=f[1]:1,(p=fork())?e(p),o? +r(o,0)D o)D*f):4,wait(0):(o?dup2(*f,0)D*f)D o):*i?1 D +0),e(open(*i,0)):5,t?dup2(t,1)D t):i[2]?9 D +1),e(creat(i[2],438)):2,e(execvp(*u,u))):e(chdir(u[1])*2):6;} +e(x){x<0?write(2,"?\n$ "-x/4,2),x+1||(exit(1),0):5;} +