diff options
author | Gerald Combs <gerald@wireshark.org> | 2016-09-15 18:20:05 -0700 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2016-09-16 15:57:09 +0000 |
commit | f317a2b304f50392b360ac95de995459a24c3b7d (patch) | |
tree | ff1864fb535a5f2cc200f83127a8cd281fcd2390 /wireshark-qt.cpp | |
parent | 547a5c8c9e71a19fd44addec741289da4febcbe3 (diff) |
Qt: Argument vector fixups.
In wireshark-qt.cpp we have two "argv" variables, one that we pass to
QCoreApplication (which it then corrupts irreversibly on Windows if you
pass it multibyte characters), and one that we convert to UTF-8 and use
normally.
Name the throwaway argument vector "qt_argv". Name ours "argv", which is
the traditional and less error-prone name.
Bug: 12900
Change-Id: Idd80b9f779f36ffe977465afd623d320212f92b1
Reviewed-on: https://code.wireshark.org/review/17723
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'wireshark-qt.cpp')
-rw-r--r-- | wireshark-qt.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/wireshark-qt.cpp b/wireshark-qt.cpp index 950950774d..8a9089b362 100644 --- a/wireshark-qt.cpp +++ b/wireshark-qt.cpp @@ -308,7 +308,7 @@ reset_library_path(void) #endif /* And now our feature presentation... [ fade to music ] */ -int main(int argc, char *argv[]) +int main(int argc, char *qt_argv[]) { MainWindow *main_w; @@ -316,7 +316,7 @@ int main(int argc, char *argv[]) int opt; #endif int ret_val; - char **ws_argv = argv; + char **argv = qt_argv; #ifdef _WIN32 WSADATA wsaData; @@ -357,11 +357,11 @@ int main(int argc, char *argv[]) #ifdef _WIN32 // QCoreApplication clobbers argv. Let's have a local copy. - ws_argv = (char **) g_malloc(sizeof(char *) * argc); + argv = (char **) g_malloc(sizeof(char *) * argc); for (opt = 0; opt < argc; opt++) { - ws_argv[opt] = argv[opt]; + argv[opt] = qt_argv[opt]; } - arg_list_utf_16to8(argc, ws_argv); + arg_list_utf_16to8(argc, argv); create_app_running_mutex(); #endif /* _WIN32 */ @@ -376,7 +376,7 @@ int main(int argc, char *argv[]) /* * Attempt to get the pathname of the executable file. */ - /* init_progfile_dir_error = */ init_progfile_dir(ws_argv[0], + /* init_progfile_dir_error = */ init_progfile_dir(argv[0], (int (*)(int, char **)) get_gui_compiled_info); g_log(NULL, G_LOG_LEVEL_DEBUG, "progfile_dir: %s", get_progfile_dir()); @@ -450,14 +450,14 @@ int main(int argc, char *argv[]) g_free(rf_path); } - commandline_early_options(argc, ws_argv, comp_info_str, runtime_info_str); + commandline_early_options(argc, argv, comp_info_str, runtime_info_str); #ifdef _WIN32 reset_library_path(); #endif /* Create The Wireshark app */ - WiresharkApplication ws_app(argc, argv); + WiresharkApplication ws_app(argc, qt_argv); /* initialize the funnel mini-api */ // xxx qtshark |