diff options
author | Stephan Mühlstrasser <stm@pdflib.com> | 2018-04-26 10:15:26 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2018-05-03 15:19:20 +0200 |
commit | 7f41432c191c70f7f782802cd17e95e87a9a7671 (patch) | |
tree | 04d464d49968e5a04c8c1f6739ad9eda81acd2a0 /lib/curl_ctype.c | |
parent | 0be4679ba93361b36187d500fb0a26b2acb05e32 (diff) |
URL: fix ASCII dependency in strcpy_url and strlen_url
Commit 3c630f9b0af097663a64e5c875c580aa9808a92b partially reverted the
changes from commit dd7521bcc1b7a6fcb53c31f9bd1192fcc884bd56 because of
the problem that strcpy_url() was modified unilaterally without also
modifying strlen_url(). As a consequence strcpy_url() was again
depending on ASCII encoding.
This change fixes strlen_url() and strcpy_url() in parallel to use a
common host-encoding independent criterion for deciding whether an URL
character must be %-escaped.
Closes #2535
Diffstat (limited to 'lib/curl_ctype.c')
-rw-r--r-- | lib/curl_ctype.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/curl_ctype.c b/lib/curl_ctype.c index f57a11dc9..1a47fb5e6 100644 --- a/lib/curl_ctype.c +++ b/lib/curl_ctype.c @@ -123,4 +123,11 @@ int Curl_islower(int c) return (ascii[c] & (_L)); } +int Curl_iscntrl(int c) +{ + if((c < 0) || (c >= 0x80)) + return FALSE; + return (ascii[c] & (_C)); +} + #endif /* !CURL_DOES_CONVERSIONS */ |