lua-users home
lua-l archive

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

>> #define LUA_ROOT       "C:\\Program Files\\Lua51"
>> #define LUA_LDIR       LUA_ROOT "\\lua"
>> #define LUA_CDIR       LUA_ROOT "\\dll"

>I question the use of these strings.
>"C:\\Program Files" opens one up to the famous security hole
>of someone installing C:\program.exe. If you must use this
>convention then %ProgramFiles% is available in the environment.
>It beats the hardcoded string.

Yep, you always need to quote Windows filenames in order to make them 
unambiguous. I suppose that is the price for allowing space as both a 
delimiter and a not-a-delimiter at the command prompt :-)

Also, the string %ProgramFiles% is locale-sensitive, is it not? This means 
it can't be hard-coded to a specific value. Actually, I don't think I mean 
locale-sensitive, I think I mean "the name of the %ProgramFiles% directory 
depends on the language version of Windows you used at install time". 
Anyway, %ProgramFiles% isn't even invariably on the C: drive -- the drive 
letter used for the Windows "root drive" depends on numerous things, 
including the way the disk is partitioned at the time you install Windows.