Housekeeping
This commit is contained in:
parent
c174832c8e
commit
81a995090f
10
src/modal.c
10
src/modal.c
|
@ -1,5 +1,4 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
typedef struct {
|
||||
char *a, *b;
|
||||
|
@ -46,8 +45,7 @@ writereg(char r)
|
|||
while((c = *s++)) {
|
||||
if(c == '(') depth++;
|
||||
if(c == ')') --depth;
|
||||
if(c == ' ' && !depth)
|
||||
break;
|
||||
if(c == ' ' && !depth) break;
|
||||
*outp_++ = c;
|
||||
}
|
||||
return 1;
|
||||
|
@ -57,8 +55,7 @@ static void
|
|||
save(void)
|
||||
{
|
||||
int i, end = outp_ - outp;
|
||||
for(i = 0; i < end; i++)
|
||||
prog[i] = outp[i];
|
||||
for(i = 0; i < end; i++) prog[i] = outp[i];
|
||||
prog[i] = 0;
|
||||
prog_ = prog;
|
||||
outp_ = outp;
|
||||
|
@ -76,12 +73,11 @@ rewrite(void)
|
|||
char *res = match(p, r);
|
||||
if(res != NULL) {
|
||||
char cc, *b = r->b;
|
||||
while((cc = *b++)) {
|
||||
while((cc = *b++))
|
||||
if(cc == '?')
|
||||
writereg(*b++);
|
||||
else
|
||||
*outp_++ = cc;
|
||||
}
|
||||
found = 1;
|
||||
p = res;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue