]> wimlib.net Git - wimlib/blobdiff - programs/imagex.c
Fix glob()
[wimlib] / programs / imagex.c
index 580e65acd530fbd3f95f193246f154ef2814805d..0f65ae51cbdd1a18ef988fae3ef4f529f5a92717 100644 (file)
@@ -38,6 +38,7 @@
 #include <string.h>
 #include <sys/stat.h>
 #include <unistd.h>
+#include <locale.h>
 
 #ifdef HAVE_ALLOCA_H
 #include <alloca.h>
@@ -2120,6 +2121,8 @@ int main(int argc, char **argv)
        const struct imagex_command *cmd;
        int ret;
 
+       setlocale(LC_ALL, "");
+
        if (argc < 2) {
                imagex_error("No command specified");
                usage_all();
@@ -2135,8 +2138,7 @@ int main(int argc, char **argv)
        /* The user may like to see more informative error messages. */
        wimlib_set_print_errors(true);
 
-       /* Calling wimlib_global_init() is not strictly necessary because
-        * 'imagex' is single-threaded. */
+       /* Do any initializations that the library needs */
        ret = wimlib_global_init();
        if (ret)
                goto out;
@@ -2175,8 +2177,9 @@ out:
                if (ret == WIMLIB_ERR_NTFS_3G && errno != 0)
                        imagex_error_with_errno("errno");
        }
-       /* Calling wimlib_global_cleanup() is not strictly necessary because the
-        * process is exiting anyway. */
+
+       /* Make the library free any resources it's holding (not strictly
+        * necessary because the process is ending anyway). */
        wimlib_global_cleanup();
        return ret;
 }