View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
---|---|---|---|---|---|---|---|---|---|
0006376 | Spring engine | Lua | public | 2020-03-30 19:42 | 2020-07-04 17:08 | ||||
Reporter | Sanguinario_Joe | ||||||||
Assigned To | gajop | ||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||
Status | resolved | Resolution | fixed | ||||||
Product Version | 104.0 +git | ||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0006376: Impossible to map (VFS.MapArchive) archives inside subfolders | ||||||||
Description | VFS.MapArchive starts with the following code chunk: === const std::string& filename = archiveScanner->ArchiveFromName(luaL_checkstring(L, 1)); // the path may point to a file or dir outside of any data-dir if (!LuaIO::IsSimplePath(filename)) return 0; if (!CFileHandler::FileExists(filename, SPRING_VFS_RAW)) { std::ostringstream buf; buf << "[" << __func__ << "] archive not found: " << filename; lua_pushboolean(L, false); lua_pushsstring(L, buf.str()); return 2; } === However, if the provided file name in luaL_checkstring(L, 1) is a map (which is therefore inside maps subfolder), then archiveScanner->ArchiveFromName will return the filename, without the subfolder prefix, so CFileHandler::FileExists will inexorably fail... | ||||||||
Steps To Reproduce | Create a dumb widget which is just simply mapping a file, and check the returned boolean variable and error string. | ||||||||
Additional Information | --- I tried replacing all the code chunk above by the following: const std::string& filename = luaL_checkstring(L, 1); and it worked just fine. I would say vfsHandler->AddArchive is robust enough to can avoid all those checks before, but I'm not that sure, so I submit an issue rather than a PR. --- I checked it is failing in maintenance, no idea about develop --- Apparently VFS.UnmapArchive is working fine --- I'm afraid VFS.UseArchive is affected by similar inconsistencies, since it calls to CFileHandler::FileExists with the filename instead of the filepath | ||||||||
Tags | No tags attached. | ||||||||
Checked infolog.txt for Errors | Yes | ||||||||
Attached Files |
|
![]() |
|
Sanguinario_Joe (reporter) 2020-04-02 19:06 |
I created PRs for both maintenance and develop: https://github.com/spring/spring/pull/510 https://github.com/spring/spring/pull/509 |
![]() |
|||
Date Modified | Username | Field | Change |
---|---|---|---|
2020-03-30 19:42 | Sanguinario_Joe | New Issue | |
2020-04-02 19:06 | Sanguinario_Joe | Note Added: 0020377 | |
2020-07-04 17:08 | Kloot | Assigned To | => gajop |
2020-07-04 17:08 | Kloot | Status | new => resolved |
2020-07-04 17:08 | Kloot | Resolution | open => fixed |