diff --git a/main.c b/main.c index 6e5564d..2eb1279 100644 --- a/main.c +++ b/main.c @@ -34,7 +34,7 @@ #include #endif -__RCSID("$MirOS: src/bin/mksh/main.c,v 1.315 2016/08/04 20:31:01 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/main.c,v 1.316 2016/08/04 20:32:14 tg Exp $"); extern char **environ; @@ -1096,9 +1096,11 @@ reclaim(void) static void remove_temps(struct temp *tp) { - for (; tp != NULL; tp = tp->next) + while (tp) { if (tp->pid == procpid) unlink(tp->tffn); + tp = tp->next; + } } /* diff --git a/syn.c b/syn.c index 343f0f9..8892c1a 100644 --- a/syn.c +++ b/syn.c @@ -23,7 +23,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/syn.c,v 1.113 2016/07/25 21:05:25 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/syn.c,v 1.114 2016/08/04 20:32:14 tg Exp $"); struct nesting_state { int start_token; /* token than began nesting (eg, FOR) */ @@ -964,9 +964,11 @@ assign_command(const char *s, bool docommand) static int inalias(struct source *s) { - for (; s && s->type == SALIAS; s = s->next) + while (s && s->type == SALIAS) { if (!(s->flags & SF_ALIASEND)) return (1); + s = s->next; + } return (0); }