tree: reformat

Done automatically by clang-format
This commit is contained in:
Jeremy Baxter 2024-03-12 12:21:39 +13:00
parent 669eb3fd28
commit 30a1097bb0
8 changed files with 311 additions and 278 deletions

View file

@ -68,7 +68,7 @@ environ_newindex(lua_State *L)
if (lua_isnil(L, 3)) {
ret = unsetenv(variable); /* remove variable from environ */
if (ret == 0) /* did unsetenv succeed? */
if (ret == 0) /* did unsetenv succeed? */
return 0;
/* if unsetenv didn't succeed:
@ -77,18 +77,18 @@ environ_newindex(lua_State *L)
}
value = luaL_checkstring(L, 3);
ret = setenv(variable, value, 1);
ret = setenv(variable, value, 1);
if (ret == 0) /* did setenv succeed? */
return 0;
switch (errno) {
case EINVAL:
return luaL_error(L, "invalid input string");
break;
case ENOMEM:
return luaL_error(L, "insufficient memory");
break;
case EINVAL:
return luaL_error(L, "invalid input string");
break;
case ENOMEM:
return luaL_error(L, "insufficient memory");
break;
}
return 0;