*/
#endif
/*--*/
- {"strict_mime", DT_BOOL, R_NONE, OPTSTRICTMIME, "no" },
- {"rfc2047_parameters", DT_BOOL, R_NONE, OPTRFC2047PARAMS, "yes"},
{ NULL, -1, R_NONE, -1, NULL }
};
quadopt_t luaM_checkquadopt(lua_State *Ls, int narg)
{
const char *s;
- int i = luaL_checkinteger(Ls, narg);
+ int i;
+
+ if (lua_type(Ls, narg) == LUA_TSTRING) {
+ s = lua_tostring(Ls, narg);
+ switch (mlua_which_token(s, -1)) {
+ case LTK_YES: return M_YES;
+ case LTK_NO: return M_NO;
+ case LTK_ASK_YES: return M_ASKYES;
+ case LTK_ASK_NO: return M_ASKNO;
+ default:
+ break;
+ }
+ }
+ i = luaL_checkinteger(Ls, narg);
if (i & ~3) {
s = lua_pushfstring(Ls, "int in [0-3] expected, got %d", i);
return luaL_argerror(Ls, narg, s);