aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/fs/download.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/fs/download.c')
-rw-r--r--src/plugins/fs/download.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/plugins/fs/download.c b/src/plugins/fs/download.c
index 2a197853..cadb3f34 100644
--- a/src/plugins/fs/download.c
+++ b/src/plugins/fs/download.c
@@ -111,14 +111,14 @@ refreshDirectoryViewFromDisk(DownloadList * list) {
111 return; 111 return;
112 112
113 if (0 != stat(list->filename, 113 if (0 != stat(list->filename,
114 &buf)) 114 &buf))
115 return; 115 return;
116 if (S_ISDIR(buf.st_mode)) { 116 if (S_ISDIR(buf.st_mode)) {
117 fn = MALLOC(strlen(list->filename) + strlen(GNUNET_DIRECTORY_EXT) + 1); 117 fn = MALLOC(strlen(list->filename) + strlen(GNUNET_DIRECTORY_EXT) + 1);
118 strcpy(fn, list->filename); 118 strcpy(fn, list->filename);
119 if (fn[strlen(fn)-1] == '/') 119 if (fn[strlen(fn)-1] == '/')
120 fn[strlen(fn)-1] = '\0'; 120 fn[strlen(fn)-1] = '\0';
121 strcat(fn, GNUNET_DIRECTORY_EXT); 121 strcat(fn, GNUNET_DIRECTORY_EXT);
122 if (0 != stat(list->filename, 122 if (0 != stat(list->filename,
123 &buf)) { 123 &buf)) {
124 FREE(fn); 124 FREE(fn);
@@ -453,10 +453,10 @@ void fs_download_stopped(DownloadList * list) {
453 valid = gtk_tree_model_iter_children(model, 453 valid = gtk_tree_model_iter_children(model,
454 &iter, 454 &iter,
455 &piter); 455 &piter);
456 while (TRUE == valid) 456 while (TRUE == valid)
457 valid = gtk_tree_store_remove(GTK_TREE_STORE(model), 457 valid = gtk_tree_store_remove(GTK_TREE_STORE(model),
458 &iter); 458 &iter);
459 } 459 }
460 } 460 }
461 if (list->searchViewRowReference != NULL) { 461 if (list->searchViewRowReference != NULL) {
462 gtk_tree_row_reference_free(list->searchViewRowReference); 462 gtk_tree_row_reference_free(list->searchViewRowReference);
@@ -602,7 +602,7 @@ initiateDownload(GtkTreeModel * model,
602 if (idc_name == NULL) { 602 if (idc_name == NULL) {
603#ifdef WINDOWS 603#ifdef WINDOWS
604 char * filehash; 604 char * filehash;
605 605
606 filehash = STRDUP(sdc.uri_name); 606 filehash = STRDUP(sdc.uri_name);
607 filehash[16] = 0; 607 filehash[16] = 0;
608 idc_name = STRDUP(filehash); 608 idc_name = STRDUP(filehash);
@@ -612,7 +612,7 @@ initiateDownload(GtkTreeModel * model,
612#endif 612#endif
613 } 613 }
614 614
615 /* dname = directory portion of idc_name */ 615 /* dname = directory portion of idc_name */
616 cname = idc_name; 616 cname = idc_name;
617 dname = STRDUP(idc_name); 617 dname = STRDUP(idc_name);
618 cname = &dname[strlen(dname)-1]; 618 cname = &dname[strlen(dname)-1];
@@ -684,14 +684,14 @@ initiateDownload(GtkTreeModel * model,
684 sdc.idc_final_download_destination = MALLOC(strlen(final_download_dir) + 2 + 684 sdc.idc_final_download_destination = MALLOC(strlen(final_download_dir) + 2 +
685 strlen(idc_name) + strlen(GNUNET_DIRECTORY_EXT) + 685 strlen(idc_name) + strlen(GNUNET_DIRECTORY_EXT) +
686 strlen(dirPath)); 686 strlen(dirPath));
687 strcpy(sdc.idc_final_download_destination, 687 strcpy(sdc.idc_final_download_destination,
688 final_download_dir); 688 final_download_dir);
689 if (sdc.idc_final_download_destination[strlen(sdc.idc_final_download_destination)-1] != DIR_SEPARATOR) 689 if (sdc.idc_final_download_destination[strlen(sdc.idc_final_download_destination)-1] != DIR_SEPARATOR)
690 strcat(sdc.idc_final_download_destination, 690 strcat(sdc.idc_final_download_destination,
691 DIR_SEPARATOR_STR); 691 DIR_SEPARATOR_STR);
692 strcat(sdc.idc_final_download_destination, 692 strcat(sdc.idc_final_download_destination,
693 dirPath); 693 dirPath);
694 strcat(sdc.idc_final_download_destination, 694 strcat(sdc.idc_final_download_destination,
695 idc_name); 695 idc_name);
696 sdc.anonymity = getSpinButtonValue(sdc.searchContext->searchXML, 696 sdc.anonymity = getSpinButtonValue(sdc.searchContext->searchXML,
697 "downloadAnonymitySpinButton"); 697 "downloadAnonymitySpinButton");
@@ -777,21 +777,21 @@ void on_statusDownloadURIEntry_editing_done_fs(GtkWidget * entry,
777 disk_directory_create(ectx, final_download_dir); 777 disk_directory_create(ectx, final_download_dir);
778 dname = &uris[strlen(ECRS_URI_PREFIX) + strlen(ECRS_FILE_INFIX)]; 778 dname = &uris[strlen(ECRS_URI_PREFIX) + strlen(ECRS_FILE_INFIX)];
779 sdc.idc_final_download_destination = MALLOC(strlen(final_download_dir) + strlen(dname) + 2); 779 sdc.idc_final_download_destination = MALLOC(strlen(final_download_dir) + strlen(dname) + 2);
780 strcpy(sdc.idc_final_download_destination, 780 strcpy(sdc.idc_final_download_destination,
781 final_download_dir); 781 final_download_dir);
782 FREE(final_download_dir); 782 FREE(final_download_dir);
783 if (sdc.idc_final_download_destination[strlen(sdc.idc_final_download_destination)] != DIR_SEPARATOR) 783 if (sdc.idc_final_download_destination[strlen(sdc.idc_final_download_destination)] != DIR_SEPARATOR)
784 strcat(sdc.idc_final_download_destination, 784 strcat(sdc.idc_final_download_destination,
785 DIR_SEPARATOR_STR); 785 DIR_SEPARATOR_STR);
786 strcat(sdc.idc_final_download_destination, 786 strcat(sdc.idc_final_download_destination,
787 dname); 787 dname);
788 788
789 addLogEntry(_("Downloading `%s'"), 789 addLogEntry(_("Downloading `%s'"),
790 uris); 790 uris);
791 sdc.idc_meta = ECRS_createMetaData(); 791 sdc.idc_meta = ECRS_createMetaData();
792 sdc.anonymity = getSpinButtonValue(getMainXML(), 792 sdc.anonymity = getSpinButtonValue(getMainXML(),
793 "fsstatusAnonymitySpin"); 793 "fsstatusAnonymitySpin");
794 sdc.recursive = NO; 794 sdc.recursive = NO;
795 sdc.searchContext = NULL; 795 sdc.searchContext = NULL;
796 sdc.parentContext = NULL; 796 sdc.parentContext = NULL;
797 run_with_save_calls(&init_download_helper, 797 run_with_save_calls(&init_download_helper,