lua-users home
lua-l archive

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


Wouldn't Pauls initial suggestion be enough? Only replace if its the first character, without further complicating things


Paul K <paulclinger@yahoo.com> schreef:
Hi Roberto,

> This substitution only happens the first time Lua sets the path
> (either from LUA_PATH or from the default from luaconf). If you
> set the path by other means, you can avoid the problem. You may

Unfortunately, in this case I need to use LUA_PATH/_CPATH.

> (To fix this problem, maybe we should use some kind of escape. Your
> particular user needed an '!' in the path, but other users may need
> a '?' or even a ';'; all are valid characters in path names.)

This would be ideal as it would solve this problem and allow all the
characters to be used in path names. '%!' perhaps?

Paul.

On Wed, Aug 8, 2012 at 6:07 AM, Roberto Ierusalimschy
<roberto@inf.puc-rio.br> wrote:
>> Notice that the exclamation mark in the path gets replaced (as
>> documented). You can dismiss it as the case of "when I do this it
>> hurts; don't do it", but it's not a hypothetical case; I got this
>> error message from one of my users.
>>
>> I'd like to know if there is a way to avoid this behavior (or a
>> workaround) other than recompiling lua with this turned off.
>> Ideally I think this needs to be fixed with '!' only replaced if it's
>> at the beginning of the path.
>
> This substitution only happens the first time Lua sets the path
> (either from LUA_PATH or from the default from luaconf). If you
> set the path by other means, you can avoid the problem. You may
> try something like this:
>
> bin\lua -e "package.path='/Lua/!me/zbs/lualibs/?/?.lua'" -e "require'foo'"
>
>
> (To fix this problem, maybe we should use some kind of escape. Your
> particular user needed an '!' in the path, but other users may need
> a '?' or even a ';'; all are valid characters in path names.)
>
> -- Roberto
>