about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMarco Peereboom <marco@conformal.com>2012-01-27 16:51:28 -0600
committerMarco Peereboom <marco@conformal.com>2012-01-27 16:51:28 -0600
commit2f671403f5021fefaa166654b4073ad3754fdd1b (patch)
tree13a94d50991b77fd2abe5da59489b1f3804f6a18
parent9f9d2b7b5286d704078a3351dca0d2c3bc0d0e30 (diff)
downloadxombrero-2f671403f5021fefaa166654b4073ad3754fdd1b.tar.gz
fix dowloads + unlink in download manager on windows
-rw-r--r--about.c4
-rw-r--r--xxxterm.c11
2 files changed, 14 insertions, 1 deletions
diff --git a/about.c b/about.c
index bfaa5e3..ba05078 100644
--- a/about.c
+++ b/about.c
@@ -516,8 +516,12 @@ xtp_handle_dl(struct tab *t, uint8_t cmd, int id)
 		RB_REMOVE(download_list, &downloads, d);
 		break;
 	case XT_XTP_DL_UNLINK:
+#ifdef __MINGW32__
+		unlink(webkit_download_get_destination_uri(d->download));
+#else
 		unlink(webkit_download_get_destination_uri(d->download) +
 		    strlen("file://"));
+#endif
 		/* FALLTHROUGH */
 	case XT_XTP_DL_REMOVE:
 		webkit_download_cancel(d->download); /* just incase */
diff --git a/xxxterm.c b/xxxterm.c
index ed7e01e..3bf1b0f 100644
--- a/xxxterm.c
+++ b/xxxterm.c
@@ -4461,10 +4461,19 @@ download_start(struct tab *t, struct download *d, int flag)
 			uri = NULL;
 			filename = g_strdup_printf("%d%s", i, suggested_name);
 		}
+#ifdef __MINGW32__
+		uri = g_strdup_printf("%s\\%s", download_dir, i ?
+		    filename : suggested_name);
+#else
 		uri = g_strdup_printf("file://%s/%s", download_dir, i ?
 		    filename : suggested_name);
+#endif
 		i++;
-	} while (!stat(uri + strlen("file://"), &sb));
+#ifdef __MINGW32__
+	} while (!stat(uri, &sb));
+#else
+	} while (!stat(uri + strlen("file://"), &sb)); /* XXX is the + strlen right? */
+#endif
 
 	DNPRINTF(XT_D_DOWNLOAD, "%s: tab %d filename %s "
 	    "local %s\n", __func__, t->tab_id, filename, uri);