lua-users home
lua-l archive

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


2006/6/21, Roberto Ierusalimschy <roberto@inf.puc-rio.br>:
You are right about the problem. But your fix does not fix it :(
Non-empty format strings may also correctly result in the empty string
(e.g., "%p" or "%z" in some locales).

Oh, you're right, I hadn't thought of that! I suppose that with
strftime's API, there is no easy way around that.

Maybe you could cheat by appending a dummy char to the format, that
you then remove from the real output. For errors, strftime would still
return 0, but for "empty" strings it would return 1. That's an ugly
hack, though; probably not worth the trouble.

--
Julien Cugnière