-starting harness for gnunet-auto-share:
[oweals/gnunet.git] / src / fs / gnunet-publish.c
index 84d58138490f664de3069d83d85624f4fb314409..ef48f2d9293d7e983ec3fe66e2c26c1b256c55f1 100644 (file)
@@ -291,7 +291,8 @@ publish_inspector (void *cls, struct GNUNET_FS_FileInformation *fi,
   }
   if (!do_disable_creation_time)
     GNUNET_CONTAINER_meta_data_add_publication_date (m);
-  if (disable_extractor)
+  if ( (disable_extractor) &&
+       (NULL != *uri) )
   {
     GNUNET_FS_uri_destroy (*uri);
     *uri = NULL;
@@ -354,7 +355,7 @@ uri_ksk_continuation (void *cls, const struct GNUNET_FS_Uri *ksk_uri,
     ns = GNUNET_FS_namespace_create (ctx, pseudonym);
     if (ns == NULL)
     {
-      FPRINTF (stderr, _("Failed to create namespace `%s'\n"), pseudonym);
+      FPRINTF (stderr, _("Failed to create namespace `%s' (illegal filename?)\n"), pseudonym);
       ret = 1;
     }
     else
@@ -608,7 +609,7 @@ run (void *cls, char *const *args, const char *cfgfile,
     namespace = GNUNET_FS_namespace_create (ctx, pseudonym);
     if (NULL == namespace)
     {
-      FPRINTF (stderr, _("Could not create namespace `%s'\n"), pseudonym);
+      FPRINTF (stderr, _("Failed to create namespace `%s' (illegal filename?)\n"), pseudonym);
       GNUNET_FS_stop (ctx);
       ret = 1;
       return;
@@ -731,10 +732,14 @@ main (int argc, char *const *argv)
      0, &GNUNET_GETOPT_set_one, &verbose},
     GNUNET_GETOPT_OPTION_END
   };
-  GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "GNUnet publish starts\n");
   bo.expiration_time =
       GNUNET_FS_year_to_time (GNUNET_FS_get_current_year () + 2);
+
+  if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
+    return 2;
+
   return (GNUNET_OK ==
           GNUNET_PROGRAM_run (argc, argv, "gnunet-publish [OPTIONS] FILENAME",
                               gettext_noop