lua-users home
lua-l archive

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


Roberto Ierusalimschy wrote:
> > The correct fix is to change
> >   #define LUA_LDIR  "!lua"
> >   #define LUA_CDIR  "!dll"
> > and then use strrchr to find the last backslash and use
> > everything up to _and including it_ to replace the "!".
> I did not understand that. What is the difference between including the
> backslash from the ModuleFileName or adding it later?

That was a bit mixed up. Sorry -- it's not relevant for the
strrchr case.

The comment was targeted at the use of PathRemoveFileSpec() because:
      PathRemoveFileSpec("c:\\foo\\bar.exe") -> "c:\\foo"
  but PathRemoveFileSpec("c:\\bar.exe")      -> "c:\\"
I.e. it's not consistent wrt. the trailing backslash.