[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Problem with 5.2.0 -E interpreter option.
- From: Lorenzo Donati <lorenzodonatibz@...>
- Date: Sun, 11 Dec 2011 10:38:17 +0100
On 11/12/2011 10.26, Patrick Rapin wrote:
It seems that the "!" doesn't do what is expected to do.
For information, the "!" character is not interpreted by Windows, but
is converted to the executable path by Lua.
Thanks for the info! I got that comment wrong then.
This is done in function setprogdir in loadlib.c, using
GetModuleFileNameA function to retrieve the executable path.
When -E is set, pmain calls resetpaths in lua.c to reset search path.
The problem is that resetpaths is called *after" setprogdir, and the
"!" characters are not parsed a second time.
Ouch! This seems like a bug then!
BTW I think that the comment in luaconf.h should be adjusted to be
clearer in that respect, e.g. (emphasis mine on the suggested mods):
"In Windows, any exclamation mark ('!') in the path is replaced *(by
Lua) with* the path of the directory of the executable file of the
"In Windows, any exclamation mark ('!') in the path is replaced by the
path of the directory of the executable file of the current process."