Housekeeping

This commit is contained in:
Devine Lu Linvega 2024-04-07 15:50:27 -07:00
parent 4798fe53a5
commit c61e775241
1 changed files with 6 additions and 9 deletions

View File

@ -25,7 +25,7 @@ walk(char *s)
if(!depth) return s;
}
}
while(!spacer(s[0]) && (c = *s++))
while(!spacer(s[0]) && *s++)
;
return s;
}
@ -122,20 +122,17 @@ commit(char r, char *incoming)
}
static int
save(int rule, char *p)
save(int rule, char *s)
{
while((*outp_++ = *p++))
while((*outp_++ = *s++))
;
*outp_++ = 0;
if((direction = !direction))
prog_ = bank_b, outp_ = bank_a;
else
prog_ = bank_a, outp_ = bank_b;
if(rule >= 0) {
char *program = direction ? bank_b : bank_a;
while(program[1] && program[0] < 0x21) program++;
fprintf(stderr, "%02d %s\n", rule, program);
}
if(rule >= 0)
fprintf(stderr, "%02d %s\n", rule, prog_);
return 1;
}
@ -170,7 +167,7 @@ static int
rewrite(char *incoming)
{
char c, *p = direction ? bank_b : bank_a;
while(*p == 0xa || *p == ' ') p++;
while((c = *p) && c <= ' ') p++;
while((c = *p)) {
int i;
if(p[0] == '<' && p[1] == '>') {