mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-24 04:56:50 +03:00
[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:
parent
0b5bea4c19
commit
5d99ab2ff8
@ -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] = '/';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user