tolerate additional IPv4 address now available for gnunet.org
[oweals/gnunet.git] / src / fs / gnunet-search.c
index 2a0a153e7e4d40e195aa6e927c13ea8b723303f6..3995b1b5b405161ff3c31a989fb789f6ab6ce682 100644 (file)
@@ -14,6 +14,8 @@
     
      You should have received a copy of the GNU Affero General Public License
      along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+     SPDX-License-Identifier: AGPL3.0-or-later
 */
 /**
  * @file fs/gnunet-search.c
@@ -170,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);