lua-users home
lua-l archive

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


On 11/12/2011 10.26, Patrick Rapin wrote:
It seems that the "!" doesn't do what is expected to do.

Confirmed !

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 current process."

instead of:

"In Windows, any exclamation mark ('!') in the path is replaced by the
path of the directory of the executable file of the current process."


-- Lorenzo