Closed MasonGulu closed 6 months ago
minerobber pointed out this relevant code https://github.com/MCJack123/craftos2-lua/blob/lua-5.2/src/loslib.c#L28-L35
Specifically, if LUA_USE_POSIX
is not defined, Lua restricts itself to a set of format specifiers that it knows will be available (%R
is a C99 addition according to Jack so on a C89 system it wouldn't be available). Since Windows is not POSIX, %R
isn't in the list of allowed format specifiers, and Lua responds with an error.
Describe the bug This is a platform specific issue. On Linux calling
os.date("%R")
results in the correct formatting. On Windows calling the same snippet results in an error.To Reproduce Steps to reproduce the behavior:
lua
promptos.date("%R")
Expected behavior No Crash.
Screenshots
Environment (please complete the following information):
Additional context Add any other context about the problem here.