Use if statement over ternary in cl.parseopts

This commit is contained in:
Jeremy Baxter 2023-07-09 21:40:47 +12:00
parent 1696efaca1
commit 9329d60c45

7
lcl.c
View file

@ -252,8 +252,11 @@ cl_parseopts(lua_State *L)
lua_pushvalue(L, 3); lua_pushvalue(L, 3);
/* first function parameter: opt */ /* first function parameter: opt */
(ch == '?') ? lua_pushnil(L) : /* in case of unknown option */ if (ch == '?') /* in case of unknown option */
(ch == ':') ? lua_pushliteral(L, "*") : /* in case of missing option argument */ lua_pushnil(L);
else if (ch == ':') /* in case of missing option argument */
lua_pushliteral(L, "*");
else /* otherwise just push the option character */
lua_pushstring(L, s); lua_pushstring(L, s);
/* second function parameter: optarg */ /* second function parameter: optarg */