This commit is contained in:
Kovid Goyal
2025-04-29 10:27:43 +05:30
parent 2f921d6dec
commit 006c2811e0

View File

@@ -281,7 +281,8 @@ def generate_c_for_opt(name: str, defval: Any, opt: OptionDict) -> Iterator[str]
yield from add_list_values(*opt['choices'])
case _:
yield '\tflag.defval.type = CLI_VALUE_STRING;'
yield f'\tflag.defval.strval = {"NULL" if defval is None else c_str(defval)};'
if defval is not None:
yield f'\tflag.defval.strval = {c_str(defval)};'
def generate_c_parser_for(funcname: str, spec: str) -> Iterator[str]: