[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r2017 - gnunet-gtk/src/plugins/fs
From: |
durner |
Subject: |
[GNUnet-SVN] r2017 - gnunet-gtk/src/plugins/fs |
Date: |
Sun, 28 Aug 2005 14:59:10 -0700 (PDT) |
Author: durner
Date: 2005-08-28 14:59:06 -0700 (Sun, 28 Aug 2005)
New Revision: 2017
Modified:
gnunet-gtk/src/plugins/fs/download.c
Log:
fix symlink problem with directories
Modified: gnunet-gtk/src/plugins/fs/download.c
===================================================================
--- gnunet-gtk/src/plugins/fs/download.c 2005-08-28 21:43:17 UTC (rev
2016)
+++ gnunet-gtk/src/plugins/fs/download.c 2005-08-28 21:59:06 UTC (rev
2017)
@@ -119,6 +119,7 @@
GtkTreeIter iiter;
GtkWidget * spin;
const char * name;
+ const char * mime;
struct stat sbuf;
unsigned int anon;
GtkTreePath *dirTreePath;
@@ -131,11 +132,13 @@
uri = NULL;
meta = NULL;
name = NULL;
+ mime = NULL;
gtk_tree_model_get(model,
iter,
SEARCH_NAME, &name,
SEARCH_URI, &uri,
SEARCH_META, &meta,
+ SEARCH_MIME, &mime,
-1);
if (uri == NULL) {
BREAK();
@@ -200,7 +203,7 @@
#endif
mkdirp(fn);
pfx = MALLOC(strlen(fn) + 2 +
- strlen(name));
+ strlen(name) + 4); /* 4 = ".gnd" */
lnk = MALLOC(strlen(fn) + 2 +
strlen(filename));
strcpy(pfx, fn);
@@ -217,6 +220,18 @@
strcat(lnk,
&filename[strlen(ECRS_URI_PREFIX) +
strlen(ECRS_FILE_INFIX)]);
+
+ /* Append ".gnd" if needed */
+ if (mime && strcmp(mime, "application/gnunet-directory") == 0) {
+ int len = strlen(pfx);
+ if (len > 5 && strcmp(pfx + len - 5, ".gnd") != 0) {
+ char *end = pfx + len - 1;
+ if (*end == '/' || *end == '\\')
+ *end = 0;
+ }
+ strcat(pfx, ".gnd");
+ }
+
#ifdef WINDOWS
{
/* Do not exceed MAX_PATH under Windows
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r2017 - gnunet-gtk/src/plugins/fs,
durner <=