credential-store: move related functions to credential-store file
is_rfc3986_unreserved() and is_rfc3986_reserved_or_unreserved() are only called from builtin/credential-store.c and they are only relevant to that file so move those functions and make them static. Signed-off-by: Calvin Wan <calvinwan@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
5d1344b497
commit
f89854362c
19
strbuf.c
19
strbuf.c
@ -810,25 +810,6 @@ void strbuf_addstr_xml_quoted(struct strbuf *buf, const char *s)
|
||||
}
|
||||
}
|
||||
|
||||
int is_rfc3986_reserved_or_unreserved(char ch)
|
||||
{
|
||||
if (is_rfc3986_unreserved(ch))
|
||||
return 1;
|
||||
switch (ch) {
|
||||
case '!': case '*': case '\'': case '(': case ')': case ';':
|
||||
case ':': case '@': case '&': case '=': case '+': case '$':
|
||||
case ',': case '/': case '?': case '#': case '[': case ']':
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int is_rfc3986_unreserved(char ch)
|
||||
{
|
||||
return isalnum(ch) ||
|
||||
ch == '-' || ch == '_' || ch == '.' || ch == '~';
|
||||
}
|
||||
|
||||
static void strbuf_add_urlencode(struct strbuf *sb, const char *s, size_t len,
|
||||
char_predicate allow_unencoded_fn)
|
||||
{
|
||||
|
Reference in New Issue
Block a user