Skip to content

Commit 0482940

Browse files
committed
Deal with missing repos in testcase_mangle_repo_names
Also simplify the code a bit.
1 parent 1b6c40b commit 0482940

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

ext/testcase.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1826,14 +1826,12 @@ testcase_mangle_repo_names(Pool *pool)
18261826
for (mp = buf; *mp; mp++)
18271827
if (*mp == ' ' || *mp == '\t' || *mp == '/')
18281828
*mp = '_';
1829-
for (;;)
1830-
{
1831-
for (i = 1; i < repoid; i++)
1832-
if (!strcmp(buf, names[i]))
1833-
break;
1834-
if (i == repoid)
1835-
break;
1829+
for (i = 1; i < repoid; i++)
1830+
{
1831+
if (!names[i] || strcmp(buf, names[i]) != 0)
1832+
continue;
18361833
sprintf(mp, "_%d", mangle++);
1834+
i = 0; /* restart conflict check */
18371835
}
18381836
names[repoid] = buf;
18391837
}

0 commit comments

Comments
 (0)