fix #5460
authorChristian Grothoff <christian@grothoff.org>
Tue, 12 Feb 2019 15:09:20 +0000 (16:09 +0100)
committerChristian Grothoff <christian@grothoff.org>
Tue, 12 Feb 2019 15:09:20 +0000 (16:09 +0100)
src/fs/gnunet-search.c

index 57d8eed5d9de4eb8489213eae60b8d64f030b5d5..3995b1b5b405161ff3c31a989fb789f6ab6ce682 100644 (file)
@@ -172,8 +172,11 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info)
     is_directory =
         GNUNET_FS_meta_data_test_for_directory (info->value.search.
                                                 specifics.result.meta);
-    if (filename != NULL)
+    if (NULL != filename)
     {
+      while ( (filename[0] != '\0') &&
+             ('/' == filename[strlen(filename)-1]) )
+       filename[strlen(filename)-1] = '\0';
       GNUNET_DISK_filename_canonicalize (filename);
       if (GNUNET_YES == is_directory)
         printf ("gnunet-download -o \"%s%s\" -R %s\n", filename, GNUNET_FS_DIRECTORY_EXT, uri);