[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: os.date & MS Windows XP CRT
- From: Peter Odding <xolox@...>
- Date: Tue, 13 Mar 2007 21:55:17 +0100
Hi all! Today I crashed the Lua interpreter with a seemingly innocent
Lua script. The problem was my format string for os.date(), specifically
%e (guess how long that took me to find...)
Turns out I read about the %e conversion specification at
opengroup.org[1] while I'm running MS Windows :-|. And indeed the MSDN
page about strftime[2] doesn't mention %e.
Now comes the fun part: Instead of ignoring/copying invalid
specifications, the MS Windows XP SP2 CRT crashes (and takes the Lua
interpreter down with it.)
All the Lua manual has to say about this is that the returned string is
"formatted according to the same rules as the C function strftime".
While I understand that Lua depends on the C runtime, maybe there exists
a minimal subset that can be mentioned in the manual? Otherwise we're
expecting every user to look up his/her platforms' CRT documentation...
Thanks,
- Peter
[1] http://www.opengroup.org/onlinepubs/007908799/xsh/strftime.html
[2] http://msdn2.microsoft.com/en-us/library/fe06s4ak(VS.80).aspx
PS. Interestingly, PHP 5.2.1 doesn't crash on %e, though it does seem to
use the C runtime's strftime (might be linked against a different runtime?)
PPS. If anyone needs lua binaries before Lua Binaries is updated, I've
put mine online at http://members.home.nl/xolox/lua/. Compiled with
VS.NET/C++ Express '05 /O2, Windows SDK /XP32 /RELEASE. Lua compiler
statically linked of course ;)