summaryrefslogtreecommitdiff
path: root/riscos/download.c
diff options
context:
space:
mode:
authorAdrian Lees <adrian@aemulor.com>2005-07-09 18:30:28 +0000
committerAdrian Lees <adrian@aemulor.com>2005-07-09 18:30:28 +0000
commitcfcc08137d844a35899bdaea3aa77052a7a4b11d (patch)
treec2ce4725a76dd0d5cb0d679ea00c8f61b036c2de /riscos/download.c
parentb49dc7e760772f8d51a79984424363cf0f3f7de9 (diff)
downloadnetsurf-cfcc08137d844a35899bdaea3aa77052a7a4b11d.tar.gz
netsurf-cfcc08137d844a35899bdaea3aa77052a7a4b11d.tar.bz2
[project @ 2005-07-09 18:30:28 by adrianl]
Stylistic changes svn path=/import/netsurf/; revision=1791
Diffstat (limited to 'riscos/download.c')
-rw-r--r--riscos/download.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/riscos/download.c b/riscos/download.c
index 491adcea0..3f64cd315 100644
--- a/riscos/download.c
+++ b/riscos/download.c
@@ -864,7 +864,6 @@ bool ro_gui_download_check_space(struct gui_download_window *dw,
if ((bits)max_file < dw->total_size || (!free_hi && free_lo < dw->total_size)) {
char *dest_canon, *orig_canon;
- const char *a, *b;
bits space;
if (!orig_file || !dw->file) {
@@ -881,25 +880,22 @@ bool ro_gui_download_check_space(struct gui_download_window *dw,
if (!orig_canon) orig_canon = (char*)orig_file;
/* not enough space; allow for the file's original location
- when space is tight (assuming the FS isn't brain damaged!) */
+ when space is tight by comparing the first part of the two
+ pathnames (and assuming the FS isn't brain damaged!) */
- a = dest_canon; b = orig_canon;
- while (toupper(*a) == toupper(*b)) {
- if (*a == '.' && *b == '.') {
- int allocation;
+ char *dot = strchr(orig_canon, '.');
+ if (dot && !strncasecmp(dest_canon, orig_canon, (dot + 1) - orig_canon)) {
+ int allocation;
- error = xosargs_read_allocation(dw->file,
- &allocation);
- if (error) {
- LOG(("xosargs_read_allocation: 0x%x : %s",
- error->errnum, error->errmess));
- }
- else {
- space += allocation;
- }
- break;
+ error = xosargs_read_allocation(dw->file,
+ &allocation);
+ if (error) {
+ LOG(("xosargs_read_allocation: 0x%x : %s",
+ error->errnum, error->errmess));
+ }
+ else {
+ space += allocation;
}
- a++; b++;
}
if (dest_canon != dest_file) free(dest_canon);