Force 'captivemodid' checking during any W32 module loading.
[captive.git] / src / client / fuse / main.c
index 27c90dc..b805c71 100644 (file)
@@ -28,6 +28,8 @@
 
 #include <captive/client-vfs.h>
 #include <captive/macros.h>
+#include <captive/client.h>
+#include <captive/captivemodid.h>
 
 #include "main.h"      /* self */
 #include "op_statfs.h"
@@ -132,17 +134,7 @@ const char *image_filename;
                        |G_LOG_LEVEL_DEBUG
                        ));
 
-       /* Prevent output block buffering if redirecting stdout to file. */
-       setvbuf(stdout,(char *)NULL,_IONBF,0);
-       setvbuf(stderr,(char *)NULL,_IONBF,0);
-
-       /* Initialize the i18n stuff */
-       setlocale(LC_ALL,"");
-       bindtextdomain(PACKAGE,LOCALEDIR);
-       textdomain(PACKAGE);
-
-       /* Initialize GObject subsystem of GLib. */
-       g_type_init();
+       captive_standalone_init();
 
        captive_options_init(&options);
        captive_options=&options;       /* for parsing by 'CAPTIVE_POPT_INCLUDE' */
@@ -184,8 +176,6 @@ const char *image_filename;
        for (csp=rest_argv,rest_argc=0;csp && *csp;csp++)
                rest_argc++;
 
-       captive_options=NULL;   /* already parsed by 'CAPTIVE_POPT_INCLUDE' */
-
        /* Override the (default) Captive options with mount(8) supplied "-o" argument. */
        /* rest_argv[0] is the device now. */
        /* rest_argv[1] is the mountpoint now. */
@@ -220,6 +210,9 @@ const char *cs=rest_argv[3];
                g_error(_("image_iochannel failed open of: %s"),image_filename);
                return EXIT_FAILURE;
                }
+       
+       if (!options.captivemodid)
+               options.captivemodid=captive_captivemodid_load_default(FALSE);
 
        if (options.filesystem.type==CAPTIVE_OPTIONS_MODULE_TYPE_EMPTY) {
 const char *self_prefix="mount.captive-";
@@ -248,6 +241,9 @@ struct captive_options_module *options_module;
                options.load_module=g_list_append(options.load_module,options_module);
                }
 
+       /* It is still required for: captive_options_module_load() */
+       captive_options=NULL;   /* already parsed by 'CAPTIVE_POPT_INCLUDE' */
+
        if (GNOME_VFS_OK!=captive_vfs_new(&capfuse_captive_vfs_object,&options)) {
                g_error(_("captive_vfs_new() failed"));
                return EXIT_FAILURE;