-options to play with
[oweals/gnunet.git] / src / fs / gnunet-helper-fs-publish.c
index 9291bd4562537188f0f175b1016ee36078084857..add45ede68911c3fd9020cd2ebbf7a28f01aa313 100644 (file)
@@ -448,6 +448,9 @@ int main(int argc,
    * binary mode.
    */
   _setmode (1, _O_BINARY);
+  /* Get utf-8-encoded arguments */
+  if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
+    return 5;
 #else
   ignore_sigpipe ();
 #endif
@@ -458,6 +461,9 @@ int main(int argc,
     FPRINTF (stderr, 
             "%s",
             "gnunet-helper-fs-publish needs exactly one or two arguments\n");
+#if WINDOWS
+    GNUNET_free ((void*) argv);
+#endif
     return 1;
   }
   filename_expanded = argv[1];
@@ -477,6 +483,9 @@ int main(int argc,
   {
     (void) write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_ERROR, NULL, 0);
     EXTRACTOR_plugin_remove_all (plugins);
+#if WINDOWS
+    GNUNET_free ((void*) argv);
+#endif
     return 2;
   }
   /* signal that we're done counting files, so that a percentage of 
@@ -485,6 +494,9 @@ int main(int argc,
       write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_COUNTING_DONE, NULL, 0))
   {
     EXTRACTOR_plugin_remove_all (plugins);
+#if WINDOWS
+    GNUNET_free ((void*) argv);
+#endif
     return 3;  
   }
   if (NULL != root)
@@ -495,6 +507,9 @@ int main(int argc,
       (void) write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_ERROR, NULL, 0);
       free_tree (root);
       EXTRACTOR_plugin_remove_all (plugins);
+#if WINDOWS
+      GNUNET_free ((void*) argv);
+#endif
       return 4;
     }
     free_tree (root);
@@ -502,6 +517,9 @@ int main(int argc,
   /* enable "clean" shutdown by telling parent that we are done */
   (void) write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_FINISHED, NULL, 0);
   EXTRACTOR_plugin_remove_all (plugins);
+#if WINDOWS
+  GNUNET_free ((void*) argv);  
+#endif
   return 0;
 }