MCPcopy Index your code
hub / github.com/NetHack/NetHack / string_for_opt

Function string_for_opt

src/options.c:6664–6680  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6662 */
6663
6664staticfn char *
6665string_for_opt(char *opts, boolean val_optional)
6666{
6667 char *colon, *equals;
6668
6669 colon = strchr(opts, ':');
6670 equals = strchr(opts, '=');
6671 if (!colon || (equals && equals < colon))
6672 colon = equals;
6673
6674 if (!colon || !*++colon) {
6675 if (!val_optional)
6676 config_error_add("Missing parameter for '%s'", opts);
6677 return empty_optstr;
6678 }
6679 return colon;
6680}
6681
6682staticfn char *
6683string_for_env_opt(const char *optname, char *opts, boolean val_optional)

Callers 15

parseoptionsFunction · 0.85
optfn_align_messageFunction · 0.85
optfn_align_statusFunction · 0.85
optfn_autounlockFunction · 0.85
optfn_boulderFunction · 0.85
optfn_crash_emailFunction · 0.85
optfn_crash_nameFunction · 0.85
optfn_crash_urlmaxFunction · 0.85
optfn_discloseFunction · 0.85
optfn_fruitFunction · 0.85
optfn_hilite_statusFunction · 0.85
optfn_map_modeFunction · 0.85

Calls 1

config_error_addFunction · 0.85

Tested by

no test coverage detected