fix bryce upgrade path from 0 -> 2 re:naming

This commit is contained in:
Mike Blumenkrantz 2016-10-18 10:59:04 -04:00
parent 7a06a6b661
commit 39d561c8b4
1 changed files with 5 additions and 2 deletions

View File

@ -433,8 +433,11 @@ _bryce_rename(Bryce *b, int num)
char buf[1024], buf2[1024], *name, *p;
name = strdup(b->name);
if (b->version >= 2)
{
p = strrchr(name, '_');
p[0] = 0;
}
snprintf(buf, sizeof(buf), "__bryce%s", name);
snprintf(buf2, sizeof(buf2), "__bryce%s_%d", name, num);
e_gadget_site_rename(buf, buf2);