formula(), transform while loop

This commit is contained in:
rlar 2016-05-14 12:13:29 +02:00
parent 11adf9f62c
commit c761b4432a
1 changed files with 9 additions and 4 deletions

View File

@ -890,12 +890,11 @@ formula(dico_t *dico, const char *s, const char *s_end, bool *perror)
const char *kptr = ++s; const char *kptr = ++s;
const char *arg2 = NULL; const char *arg2 = NULL;
const char *arg3 = NULL; const char *arg3 = NULL;
char d;
level = 1; level = 1;
do for (;;)
{ {
d = *kptr++; char d = *kptr++;
if (kptr > s_end) if (kptr > s_end)
d = '\0'; d = '\0';
@ -911,7 +910,13 @@ formula(dico_t *dico, const char *s, const char *s_end, bool *perror)
arg3 = kptr; /* kludge for more than 2 args (ternary expression) */ arg3 = kptr; /* kludge for more than 2 args (ternary expression) */
} /* comma list? */ } /* comma list? */
} while ((kptr <= s_end) && !((d == ')') && (level <= 0))); if (kptr > s_end) {
break;
}
if ((d == ')') && (level <= 0)) {
break;
}
}
// fixme, here level = 0 !!!!! (almost) // fixme, here level = 0 !!!!! (almost)