From 9329d60c45bc8c03095e4ccde43d6c16cb4d6733 Mon Sep 17 00:00:00 2001 From: Jeremy Baxter Date: Sun, 9 Jul 2023 21:40:47 +1200 Subject: [PATCH] Use if statement over ternary in cl.parseopts --- lcl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lcl.c b/lcl.c index 0a00bd8..34e76e6 100644 --- a/lcl.c +++ b/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 */