diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c index 574f5b87be..15690177e0 100644 --- a/src/test/regress/pg_regress.c +++ b/src/test/regress/pg_regress.c @@ -1717,14 +1717,11 @@ run_schedule(const char *schedule, test_function tfunc) */ for (rl = resultfiles[i], el = expectfiles[i], tl = tags[i]; rl != NULL; /* rl and el have the same length */ - rl = rl->next, el = el->next) + rl = rl->next, el = el->next, + tl = tl ? tl->next : NULL) { bool newdiff; - if (tl) - tl = tl->next; /* tl has the same length as rl and el - * if it exists */ - newdiff = results_differ(tests[i], rl->str, el->str); if (newdiff && tl) { @@ -1804,14 +1801,11 @@ run_single_test(const char *test, test_function tfunc) */ for (rl = resultfiles, el = expectfiles, tl = tags; rl != NULL; /* rl and el have the same length */ - rl = rl->next, el = el->next) + rl = rl->next, el = el->next, + tl = tl ? tl->next : NULL) { bool newdiff; - if (tl) - tl = tl->next; /* tl has the same length as rl and el if it - * exists */ - newdiff = results_differ(test, rl->str, el->str); if (newdiff && tl) {