[project @ 2003-10-06 16:29:27 by jmb]

use whole leafname for now

svn path=/import/netsurf/; revision=346
This commit is contained in:
John Mark Bell 2003-10-06 16:29:27 +00:00
parent 0b5bea4c19
commit 5d99ab2ff8

View File

@ -110,6 +110,7 @@ void ro_gui_download_leaf(const char *url, char *leaf)
{
char *slash;
size_t len;
int i;
/* take url from last / to first non-RISC OS character, eg. '.' */
slash = strrchr(url, '/');
@ -117,12 +118,19 @@ void ro_gui_download_leaf(const char *url, char *leaf)
strcpy(leaf, "download");
return;
}
len = strspn(slash + 1, "0123456789" "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"); /* over-paranoid */
/*len = strspn(slash + 1, "0123456789" "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz");*/ /* over-paranoid */
len = strlen(slash+1);
if (40 < len)
len = 40;
strncpy(leaf, slash + 1, len);
leaf[len] = 0;
/* swap "." for "/" */
for (i=0; i!=len; i++) {
if (leaf[i] == '.') {
leaf[i] = '/';
}
}
}