Prevent infinite loop in export template manager
This commit is contained in:
parent
55e2ff6b2e
commit
2a30f0460d
1 changed files with 7 additions and 10 deletions
|
@ -273,7 +273,7 @@ void ExportTemplateManager::_install_from_file(const String &p_file, bool p_use_
|
||||||
char fname[16384];
|
char fname[16384];
|
||||||
unzGetCurrentFileInfo(pkg, &info, fname, 16384, NULL, 0, NULL, 0);
|
unzGetCurrentFileInfo(pkg, &info, fname, 16384, NULL, 0, NULL, 0);
|
||||||
|
|
||||||
String file = fname;
|
String file = fname.get_file();
|
||||||
|
|
||||||
Vector<uint8_t> data;
|
Vector<uint8_t> data;
|
||||||
data.resize(info.uncompressed_size);
|
data.resize(info.uncompressed_size);
|
||||||
|
@ -283,21 +283,18 @@ void ExportTemplateManager::_install_from_file(const String &p_file, bool p_use_
|
||||||
unzReadCurrentFile(pkg, data.ptrw(), data.size());
|
unzReadCurrentFile(pkg, data.ptrw(), data.size());
|
||||||
unzCloseCurrentFile(pkg);
|
unzCloseCurrentFile(pkg);
|
||||||
|
|
||||||
print_line(fname);
|
|
||||||
/*
|
|
||||||
for(int i=0;i<512;i++) {
|
|
||||||
print_line(itos(data[i]));
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
file = file.get_file();
|
|
||||||
if (p) {
|
if (p) {
|
||||||
p->step(TTR("Importing:") + " " + file, fc);
|
p->step(TTR("Importing:") + " " + file, fc);
|
||||||
}
|
}
|
||||||
|
|
||||||
FileAccess *f = FileAccess::open(template_path.plus_file(file), FileAccess::WRITE);
|
FileAccess *f = FileAccess::open(template_path.plus_file(file), FileAccess::WRITE);
|
||||||
|
|
||||||
ERR_CONTINUE(!f);
|
if (!f) {
|
||||||
|
ret = unzGoToNextFile(pkg);
|
||||||
|
fc++;
|
||||||
|
ERR_CONTINUE(!f);
|
||||||
|
}
|
||||||
|
|
||||||
f->store_buffer(data.ptr(), data.size());
|
f->store_buffer(data.ptr(), data.size());
|
||||||
|
|
||||||
memdelete(f);
|
memdelete(f);
|
||||||
|
|
Loading…
Reference in a new issue