#3535 remove unnecessary escape characters and use lowercase in escaped letters in info_hash
This commit is contained in:
parent
0235bd962a
commit
05fabc6255
|
@ -387,7 +387,11 @@ is_rfc2396_alnum( char ch )
|
||||||
{
|
{
|
||||||
return ( '0' <= ch && ch <= '9' )
|
return ( '0' <= ch && ch <= '9' )
|
||||||
|| ( 'A' <= ch && ch <= 'Z' )
|
|| ( 'A' <= ch && ch <= 'Z' )
|
||||||
|| ( 'a' <= ch && ch <= 'z' );
|
|| ( 'a' <= ch && ch <= 'z' )
|
||||||
|
|| ch == '.'
|
||||||
|
|| ch == '-'
|
||||||
|
|| ch == '_'
|
||||||
|
|| ch == '~';
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -399,7 +403,7 @@ escape( char * out, const uint8_t * in, size_t in_len ) /* rfc2396 */
|
||||||
if( is_rfc2396_alnum( *in ) )
|
if( is_rfc2396_alnum( *in ) )
|
||||||
*out++ = (char) *in++;
|
*out++ = (char) *in++;
|
||||||
else
|
else
|
||||||
out += tr_snprintf( out, 4, "%%%02X", (unsigned int)*in++ );
|
out += tr_snprintf( out, 4, "%%%02x", (unsigned int)*in++ );
|
||||||
|
|
||||||
*out = '\0';
|
*out = '\0';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue