From 7d129a3e63811e5b39f61f75fc2b1e976ecfb53c Mon Sep 17 00:00:00 2001 From: Will Xyen Date: Mon, 21 Dec 2020 10:03:48 -0800 Subject: [PATCH] launcher: Actually init the default service override options and make `override_urlslash_value` more clear --- src/main/launcher/main.c | 7 ++++--- src/main/launcher/options.c | 11 +++++++---- src/main/launcher/options.h | 3 +-- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/main/launcher/main.c b/src/main/launcher/main.c index ce04b89..1a0afe9 100644 --- a/src/main/launcher/main.c +++ b/src/main/launcher/main.c @@ -285,15 +285,16 @@ int main(int argc, const char **argv) ea3_ident_to_property(&ea3, ea3_config); if (options.override_urlslash_enabled) { - log_info("Overriding url_slash to: %d", options.override_urlslash); + log_info( + "Overriding url_slash to: %d", options.override_urlslash_value); ea3_ident_replace_property_bool( ea3_config_root, "/network/url_slash", - options.override_urlslash); + options.override_urlslash_value); } - if (options.override_service_enabled) { + if (options.override_service != NULL) { log_info("Overriding service url to: %s", options.override_service); ea3_ident_replace_property_str( diff --git a/src/main/launcher/options.c b/src/main/launcher/options.c index 995aedb..8aa8d02 100644 --- a/src/main/launcher/options.c +++ b/src/main/launcher/options.c @@ -25,6 +25,10 @@ void options_init(struct options *options) options->remote_debugger = false; array_init(&options->hook_dlls); array_init(&options->before_hook_dlls); + + options->override_service = NULL; + options->override_urlslash_enabled = false; + options->override_urlslash_value = false; } bool options_read_cmdline(struct options *options, int argc, const char **argv) @@ -141,7 +145,6 @@ bool options_read_cmdline(struct options *options, int argc, const char **argv) return false; } - options->override_service_enabled = true; options->override_service = argv[++i]; break; @@ -155,12 +158,12 @@ bool options_read_cmdline(struct options *options, int argc, const char **argv) const char * urlslash_value = argv[++i]; - options->override_urlslash = false; + options->override_urlslash_value = false; if (_stricmp(urlslash_value, "1") == 0) { - options->override_urlslash = true; + options->override_urlslash_value = true; } if (_stricmp(urlslash_value, "true") == 0) { - options->override_urlslash = true; + options->override_urlslash_value = true; } break; diff --git a/src/main/launcher/options.h b/src/main/launcher/options.h index cefcaf4..68da335 100644 --- a/src/main/launcher/options.h +++ b/src/main/launcher/options.h @@ -19,10 +19,9 @@ struct options { struct array hook_dlls; struct array before_hook_dlls; bool remote_debugger; - bool override_service_enabled; const char *override_service; bool override_urlslash_enabled; - bool override_urlslash; + bool override_urlslash_value; }; void options_init(struct options *options);