mirror of
https://github.com/love2d/love.git
synced 2026-08-20 12:40:20 +02:00
Let the love.filesystem loader support the template path for multiple interrogation mark.
This commit is contained in:
@@ -631,8 +631,18 @@ int loader(lua_State *L)
|
|||||||
auto *inst = instance();
|
auto *inst = instance();
|
||||||
for (std::string element : inst->getRequirePath())
|
for (std::string element : inst->getRequirePath())
|
||||||
{
|
{
|
||||||
size_t pos = element.find('?');
|
// [Modified: 20170104] @evanyeung
|
||||||
if (pos != std::string::npos)
|
// Remark: For each template, the searcher will change
|
||||||
|
// the first interrogation mark in the template by the file name.
|
||||||
|
// size_t pos = element.find('?');
|
||||||
|
// if (pos != std::string::npos)
|
||||||
|
// element.replace(pos, 1, modulename);
|
||||||
|
|
||||||
|
// [Modified: 20170104] @evanyeung
|
||||||
|
// Remark: For each template, the searcher will change
|
||||||
|
// each interrogation mark in the template by filename.
|
||||||
|
size_t pos = 0;
|
||||||
|
while ((pos = element.find('?', pos)) != std::string::npos)
|
||||||
element.replace(pos, 1, modulename);
|
element.replace(pos, 1, modulename);
|
||||||
|
|
||||||
if (inst->isFile(element.c_str()))
|
if (inst->isFile(element.c_str()))
|
||||||
|
|||||||
Reference in New Issue
Block a user