2021-10-14 07:28:34 -04:00
|
|
|
From 4c02c080475c9d08dbed98dd64ecca337aa359ae Mon Sep 17 00:00:00 2001
|
2021-02-17 06:50:33 -05:00
|
|
|
From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzsong@member.fsf.org>
|
|
|
|
Date: Sat, 20 Feb 2021 20:37:39 +0800
|
|
|
|
Subject: [PATCH] Allow set libretro_directory via environment variable
|
|
|
|
|
|
|
|
---
|
2021-10-14 07:28:34 -04:00
|
|
|
retroarch.c | 13 ++++++++++++-
|
|
|
|
1 file changed, 12 insertions(+), 1 deletion(-)
|
2021-02-17 06:50:33 -05:00
|
|
|
|
|
|
|
diff --git a/retroarch.c b/retroarch.c
|
2021-10-14 07:28:34 -04:00
|
|
|
index 8a0461c816..cbf11d8b6a 100644
|
2021-02-17 06:50:33 -05:00
|
|
|
--- a/retroarch.c
|
|
|
|
+++ b/retroarch.c
|
2021-10-14 07:28:34 -04:00
|
|
|
@@ -17603,7 +17603,18 @@ static bool retroarch_parse_input_and_config(
|
|
|
|
p_rarch->configuration_settings->bools.log_to_file,
|
|
|
|
p_rarch->configuration_settings->bools.log_to_file_timestamp,
|
|
|
|
p_rarch->configuration_settings->paths.log_dir);
|
|
|
|
-
|
|
|
|
+
|
2021-02-17 06:50:33 -05:00
|
|
|
+ /* Override settings via environment variables */
|
2021-10-14 07:28:34 -04:00
|
|
|
+ {
|
2021-02-17 06:50:33 -05:00
|
|
|
+ settings_t *settings = p_rarch->configuration_settings;
|
2021-10-14 07:28:34 -04:00
|
|
|
+ char *value = getenv("LIBRETRO_DIRECTORY");
|
|
|
|
+ if (value != NULL)
|
|
|
|
+ {
|
|
|
|
+ retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_LIBRETRO_DIRECTORY, NULL);
|
|
|
|
+ configuration_set_string(settings, settings->paths.directory_libretro, value);
|
|
|
|
+ }
|
2021-02-17 06:50:33 -05:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
/* Second pass: All other arguments override the config file */
|
|
|
|
optind = 1;
|
|
|
|
|
|
|
|
--
|
2021-10-14 07:28:34 -04:00
|
|
|
2.33.0
|
2021-02-17 06:50:33 -05:00
|
|
|
|