[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Small change to luaconf.h
- From: Peter Drahoš <drahosp@...>
- Date: Sat, 6 Aug 2011 12:06:06 +0200
On Sat, Aug 6, 2011 at 9:28 AM, Frank Meier-Dörnberg <email@example.com> wrote:
> Am 06.08.2011 06:22, schrieb Brian Maher:
>>  Set the LUA_ROOT global variable to dirname(dirname(argv)) in
>> pmain() of lua.c
>>  Modify setpath() in loadlib.c so it replaces the special "..."
>> token with the LUA_ROOT global variable and if that fails, fall-back
>> to the LUA_ROOT compile time define.
> I'm not sure about the semantic yet, but should that not handled similar to
> what is done for windows in (Lua 5.1) luaconf.h?
> ** In Windows, any exclamation mark ('!') in the path is replaced by the
> ** path of the directory of the executable file of the current process.
> i.e.: "!" instead of "...", correct?
> Please excuse my question (I'm a windows user), why these thing is solved
> differently at all?
The difference between ".." and "!" is that the exclamation mark
executable location where the ".." is relative path in regards to the
current directory. It makes more sense to use the "!" in a portable
Lua installation. However this is only available on WIndows. In Lua
distributed with LuaDist there is a (optional) patch for loadlib
that brings this notation to other platforms. It is not however easy
to find the path of the executable consistently between various
systems hence the ugly fallback. This works as on Windows on all
systems I have access to.