mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-05 17:30:27 +00:00
Update LuaGetParam (via LuaPushUrlParams) to return empty table when no parameters (#97).
This commit is contained in:
parent
c89bc56f6a
commit
3425a8f58f
1 changed files with 1 additions and 3 deletions
|
@ -4043,8 +4043,8 @@ static int LuaGetParam(lua_State *L) {
|
|||
|
||||
static void LuaPushUrlParams(lua_State *L, struct UrlParams *h) {
|
||||
size_t i;
|
||||
lua_newtable(L);
|
||||
if (h->p) {
|
||||
lua_newtable(L);
|
||||
for (i = 0; i < h->n; ++i) {
|
||||
lua_newtable(L);
|
||||
lua_pushlstring(L, h->p[i].key.p, h->p[i].key.n);
|
||||
|
@ -4055,8 +4055,6 @@ static void LuaPushUrlParams(lua_State *L, struct UrlParams *h) {
|
|||
}
|
||||
lua_seti(L, -2, i + 1);
|
||||
}
|
||||
} else {
|
||||
lua_pushnil(L);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue