| 17 | } |
| 18 | |
| 19 | int 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 | |
| 34 | int is_url(const char *url) |
| 35 | { |
no outgoing calls
no test coverage detected