is_bad_char -> needs_urlencoding, whitespace fixes.

This commit is contained in:
Emil Mikulic 2008-10-26 12:50:28 +00:00
parent b02c1bba08
commit ca6a07f714

View File

@ -1693,7 +1693,7 @@ static void cleanup_sorted_dirlist(struct dlent **list, const ssize_t size)
/* ---------------------------------------------------------------------------
* Should this character be urlencoded (according to rfc1738)
*/
static int is_bad_char(unsigned char c)
static int needs_urlencoding(unsigned char c)
{
int i;
const static char bad[] = "<>\"%{}|^~[]`\\;:/?@#=&";
@ -1721,7 +1721,7 @@ static void urlencode_filename(unsigned char *name, unsigned char *safe_url)
for (i=j=0; i<len; i++)
{
if (is_bad_char(name[i]))
if (needs_urlencoding(name[i]))
{
safe_url[j++] = '%';
safe_url[j++] = hex[(name[i] >> 4) & 0xF];