aboutsummaryrefslogtreecommitdiffstats
path: root/capinfos.c
diff options
context:
space:
mode:
Diffstat (limited to 'capinfos.c')
-rw-r--r--capinfos.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/capinfos.c b/capinfos.c
index 52ef4ec33c..3bf92a72ca 100644
--- a/capinfos.c
+++ b/capinfos.c
@@ -1397,8 +1397,8 @@ hash_to_str(const unsigned char *hash, size_t length, char *str) {
}
}
-int
-main(int argc, char *argv[])
+static int
+real_main(int argc, char *argv[])
{
GString *comp_info_str;
GString *runtime_info_str;
@@ -1445,7 +1445,6 @@ main(int argc, char *argv[])
g_string_free(runtime_info_str, TRUE);
#ifdef _WIN32
- arg_list_utf_16to8(argc, argv);
create_app_running_mutex();
#endif /* _WIN32 */
@@ -1725,6 +1724,26 @@ exit:
return overall_error_status;
}
+#ifdef _WIN32
+int
+wmain(int argc, wchar_t *argv[])
+{
+ char **argv_utf8;
+
+ /* Convert our arg list from UTF-16LE to UTF-8. */
+ argv_utf8 = g_malloc(argc * sizeof *argv_utf8);
+ for (int i = 0; i < argc; i++)
+ argv_utf8[i] = g_utf16_to_utf8(argv[i], -1, NULL, NULL, NULL);
+ return real_main(argc, argv_utf8);
+}
+#else
+int
+main(int argc, char *argv[])
+{
+ return real_main(argc, argv);
+}
+#endif
+
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*