From 00e4ec1e04ad62928334e139be02384dedacf35f Mon Sep 17 00:00:00 2001 From: Miku AuahDark Date: Tue, 1 Mar 2022 22:34:14 +0800 Subject: [PATCH] Show deprecation notice when slashes is passed to require. Closes #1773 --- src/modules/filesystem/wrap_Filesystem.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/filesystem/wrap_Filesystem.cpp b/src/modules/filesystem/wrap_Filesystem.cpp index d30566e47..d7fd00e7f 100644 --- a/src/modules/filesystem/wrap_Filesystem.cpp +++ b/src/modules/filesystem/wrap_Filesystem.cpp @@ -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 == '.')