Use if statement over ternary in cl.parseopts
This commit is contained in:
parent
1696efaca1
commit
9329d60c45
1 changed files with 5 additions and 2 deletions
7
lcl.c
7
lcl.c
|
@ -252,8 +252,11 @@ cl_parseopts(lua_State *L)
|
|||
lua_pushvalue(L, 3);
|
||||
|
||||
/* first function parameter: opt */
|
||||
(ch == '?') ? lua_pushnil(L) : /* in case of unknown option */
|
||||
(ch == ':') ? lua_pushliteral(L, "*") : /* in case of missing option argument */
|
||||
if (ch == '?') /* in case of unknown option */
|
||||
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);
|
||||
|
||||
/* second function parameter: optarg */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue