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

Function length_without_val

src/options.c:6738–6754  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6736}
6737
6738staticfn int
6739length_without_val(const char *user_string, int len)
6740{
6741 const char *p = strchr(user_string, ':'),
6742 *q = strchr(user_string, '=');
6743
6744 if (!p || (q && q < p))
6745 p = q;
6746 if (p) {
6747 /* 'user_string' hasn't necessarily been through mungspaces()
6748 so might have tabs or consecutive spaces */
6749 while (p > user_string && isspace((uchar) *(p - 1)))
6750 p--;
6751 len = (int) (p - user_string);
6752 }
6753 return len;
6754}
6755
6756/* check whether a user-supplied option string is a proper leading
6757 substring of a particular option name; option string might have

Callers 2

parseoptionsFunction · 0.70
match_optnameFunction · 0.70

Calls 1

isspaceFunction · 0.85

Tested by

no test coverage detected