Commit Diff


commit - b59bcb53ccddc0a8f27813afbf127e54f554ae42
commit + 89e4650865dd63b981f91873704f3883ed20aa05
blob - 426494c1236e98746456cd9ff662230b5f390668
blob + 38e5d45867c2d1d73f8ea84cc296dc2c77e92d2a
--- telescope.c
+++ telescope.c
@@ -459,12 +459,6 @@ handle_save_page_path(const char *path, struct tab *ta
 		stop_tab(tab);
 		return;
 	}
-
-	/*
-	 * Change this tab id, the old one is associated with the
-	 * download now.
-	 */
-	tab->id = tab_new_id();
 
 	if ((fd = open(path, O_WRONLY|O_TRUNC|O_CREAT, 0644)) == -1) {
 		message("Can't open file %s: %s", path, strerror(errno));
@@ -476,6 +470,12 @@ handle_save_page_path(const char *path, struct tab *ta
 	d = enqueue_download(tab->id, path);
 	d->fd = fd;
 	ui_send_net(IMSG_PROCEED, d->id, NULL, 0);
+
+	/*
+	 * Change this tab id, the old one is associated with the
+	 * download now.
+	 */
+	tab->id = tab_new_id();
 }
 
 static void