MCPcopy Index your code
hub / github.com/git/git / attr_name_valid

Function attr_name_valid

attr.c:199–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197}
198
199static int attr_name_valid(const char *name, size_t namelen)
200{
201 /*
202 * Attribute name cannot begin with '-' and must consist of
203 * characters from [-A-Za-z0-9_.].
204 */
205 if (namelen <= 0 || *name == '-')
206 return 0;
207 while (namelen--) {
208 char ch = *name++;
209 if (! (ch == '-' || ch == '.' || ch == '_' ||
210 ('0' <= ch && ch <= '9') ||
211 ('a' <= ch && ch <= 'z') ||
212 ('A' <= ch && ch <= 'Z')) )
213 return 0;
214 }
215 return 1;
216}
217
218static void report_invalid_attr(const char *name, size_t len,
219 const char *src, int lineno)

Callers 3

git_attr_internalFunction · 0.85
parse_attrFunction · 0.85
parse_attr_lineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected