diff options
author | Lauri Leukkunen <lle@rahina.org> | 2007-12-10 06:58:49 +0200 |
---|---|---|
committer | Lauri Leukkunen <lle@rahina.org> | 2007-12-10 06:58:49 +0200 |
commit | 98f4d67170b0f2c617343cf19ace4a584d152eca (patch) | |
tree | 6c27414b1427529cd1e60c3c4c57302d28331bbd /luaif | |
parent | 4ee4e9f76b624ee3250f4924ce7575a3d9ce453a (diff) |
Fix host-gcc
host-gcc is run with all manglings disabled
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
Diffstat (limited to 'luaif')
-rw-r--r-- | luaif/luaif.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/luaif/luaif.c b/luaif/luaif.c index 5955cb7..effe5b6 100644 --- a/luaif/luaif.c +++ b/luaif/luaif.c @@ -248,6 +248,19 @@ static int lua_sb_log(lua_State *luastate) return 1; } +static int lua_sb_setenv(lua_State *luastate) +{ + int n = lua_gettop(luastate); + + if (n != 2) { + SB_LOG(SB_LOGLEVEL_DEBUG, + "sb_log_from_lua: wrong number of params (%d)", n); + lua_pushstring(luastate, NULL); + return 1; + } + setenv(strdup(lua_tostring(luastate, 1)), strdup(lua_tostring(luastate, 2)), 1); + return 1; +} /* mappings from c to lua */ static const luaL_reg reg[] = @@ -256,6 +269,7 @@ static const luaL_reg reg[] = {"readlink", lua_sb_readlink}, {"decolonize_path", lua_sb_decolonize_path}, {"log", lua_sb_log}, + {"setenv", lua_sb_setenv}, {NULL, NULL} }; |