lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> Using the lua.exe interpreter provided with Lua for Windows, passing any 
> letter to (os.date("%"..letter)) other than a-d, j, m, p, w-z, A, B, H, I, 
> M, S, U, or W-Z is causing to crash (as in "has encountered a problem and 
> needs to close" crash). This also happens when calling io.open with any 
> undefined format string.
> 
> That can't be right, can it? (At the very least %C, %D, %e, %h, %n, %r, %R, 
> %t, %T, %u, and %V should evaluate as they are defined in the standard 
> (http://www.opengroup.org/onlinepubs/009695399/functions/strftime.html).) 

This has been reported before (but not for io.open; thanks).
See this thread:
	http://lua-users.org/lists/lua-l/2008-09/msg00146.html

Unfortunately, the ANSI C standard allows implementations to crash when
the behaviour is said to be undefined in the standard. And it seems that
some Windows libraries take the easy way out. :-( (The reasonable behaviour
here would be to ignore unsupported directives.)

In 5.2 we'll be limited to the directives listed in ANSI C, even if the
underlying C library supports the full POSIX set. Sad, I know.