diff options
author | Nils Durner <durner@gnunet.org> | 2006-03-17 23:31:00 +0000 |
---|---|---|
committer | Nils Durner <durner@gnunet.org> | 2006-03-17 23:31:00 +0000 |
commit | 04552ebfb969ab9e74a82b94cede71b960eb2212 (patch) | |
tree | 82eea6ce0083dd1cad23570e042323ebe1f0f5cc | |
parent | 868890b1e9b1233cd320daa2a0f6d09ab593e860 (diff) | |
download | gnunet-gtk-04552ebfb969ab9e74a82b94cede71b960eb2212.tar.gz gnunet-gtk-04552ebfb969ab9e74a82b94cede71b960eb2212.zip |
cap file name (if file hash) under Windows
-rw-r--r-- | src/plugins/fs/download.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/fs/download.c b/src/plugins/fs/download.c index acc3df2c..3a9c4e06 100644 --- a/src/plugins/fs/download.c +++ b/src/plugins/fs/download.c | |||
@@ -124,6 +124,9 @@ static void initiateDownload(GtkTreeModel * model, | |||
124 | GtkTreePath *dirTreePath; | 124 | GtkTreePath *dirTreePath; |
125 | char *dirPath; | 125 | char *dirPath; |
126 | unsigned int dirPathLen; | 126 | unsigned int dirPathLen; |
127 | #ifdef WINDOWS | ||
128 | char *filehash; | ||
129 | #endif | ||
127 | 130 | ||
128 | uri = NULL; | 131 | uri = NULL; |
129 | meta = NULL; | 132 | meta = NULL; |
@@ -172,7 +175,15 @@ static void initiateDownload(GtkTreeModel * model, | |||
172 | } | 175 | } |
173 | 176 | ||
174 | if (name == NULL) | 177 | if (name == NULL) |
178 | #ifdef WINDOWS | ||
179 | { | ||
180 | filehash = STRDUP(uri_name); | ||
181 | filehash[16] = 0; | ||
182 | name = filehash; | ||
183 | } | ||
184 | #else | ||
175 | name = uri_name; | 185 | name = uri_name; |
186 | #endif | ||
176 | 187 | ||
177 | final_download_dir = getFileName("FS", | 188 | final_download_dir = getFileName("FS", |
178 | "INCOMINGDIR", | 189 | "INCOMINGDIR", |
@@ -271,6 +282,9 @@ static void initiateDownload(GtkTreeModel * model, | |||
271 | -1); | 282 | -1); |
272 | FREE(uri_name); | 283 | FREE(uri_name); |
273 | FREE(dirPath); | 284 | FREE(dirPath); |
285 | #ifdef WINDOWS | ||
286 | FREENONNULL(filehash); | ||
287 | #endif | ||
274 | FREENONNULL(final_download_dir); | 288 | FREENONNULL(final_download_dir); |
275 | 289 | ||
276 | 290 | ||