mirror of
https://github.com/transmission/transmission
synced 2024-12-26 09:37:56 +00:00
#3535 remove unnecessary escape characters and use lowercase in escaped letters in info_hash
This commit is contained in:
parent
0235bd962a
commit
05fabc6255
1 changed files with 6 additions and 2 deletions
|
@ -387,7 +387,11 @@ is_rfc2396_alnum( char ch )
|
|||
{
|
||||
return ( '0' <= ch && ch <= '9' )
|
||||
|| ( 'A' <= ch && ch <= 'Z' )
|
||||
|| ( 'a' <= ch && ch <= 'z' );
|
||||
|| ( 'a' <= ch && ch <= 'z' )
|
||||
|| ch == '.'
|
||||
|| ch == '-'
|
||||
|| ch == '_'
|
||||
|| ch == '~';
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -399,7 +403,7 @@ escape( char * out, const uint8_t * in, size_t in_len ) /* rfc2396 */
|
|||
if( is_rfc2396_alnum( *in ) )
|
||||
*out++ = (char) *in++;
|
||||
else
|
||||
out += tr_snprintf( out, 4, "%%%02X", (unsigned int)*in++ );
|
||||
out += tr_snprintf( out, 4, "%%%02x", (unsigned int)*in++ );
|
||||
|
||||
*out = '\0';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue