MCPcopy Create free account
hub / github.com/git/git / is_urlschemechar

Function is_urlschemechar

url.c:19–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17}
18
19int is_urlschemechar(int first_flag, int ch)
20{
21 /*
22 * The set of valid URL schemes, as per STD66 (RFC3986) is
23 * '[A-Za-z][A-Za-z0-9+.-]*'. But use slightly looser check
24 * of '[A-Za-z0-9][A-Za-z0-9+.-]*' because earlier version
25 * of check used '[A-Za-z0-9]+' so not to break any remote
26 * helpers.
27 */
28 int alphanumeric, special;
29 alphanumeric = ch > 0 && isalnum(ch);
30 special = ch == '+' || ch == '-' || ch == '.';
31 return alphanumeric || (!first_flag && special);
32}
33
34int is_url(const char *url)
35{

Callers 2

transport_getFunction · 0.85
is_urlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected