lua-users home
lua-l archive

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


>>>>> "Simon" == Simon Wunderlin <swunderlin@gmail.com> writes:

 Simon> For my application to work I need to set environment variables.
 Simon> Therefore I have written a simple Lua C extensions to do so:
 Simon> https://pastebin.com/NsNMHkUu

putenv() is dangerous; if your OS has setenv() you should use that
instead.

The problem with putenv() is that it does not copy the supplied string,
it just puts a pointer to it into the environment. setenv(), in
contrast, makes a copy of the supplied string.

-- 
Andrew.