Show deprecation notice when slashes is passed to require.

Closes #1773
This commit is contained in:
Miku AuahDark
2022-03-01 22:34:14 +08:00
parent 7b3e2182aa
commit 00e4ec1e04
@@ -806,6 +806,9 @@ int loader(lua_State *L)
{
std::string modulename = luax_checkstring(L, 1);
if (modulename.find('/') != std::string::npos)
luax_markdeprecated(L, 2, "character in require string (forward slashes), use dots instead.", API_CUSTOM);
for (char &c : modulename)
{
if (c == '.')