diff --git a/docs/INSTALL.md b/docs/INSTALL.md index 1d63d43f..2b2582c3 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -1,10 +1,6 @@ # Manual Installation [Download Packages Here](https://jenkins.thebrokenrail.com/job/minecraft-pi-reborn/job/master/lastSuccessfulBuild/artifact/out/) -## Supported Distributions -* Ubuntu 20.04+ -* Debian Bullseye+ - ## Picking A Package ### Name Format diff --git a/launcher/src/bootstrap.c b/launcher/src/bootstrap.c index 5da18ff8..c815f681 100644 --- a/launcher/src/bootstrap.c +++ b/launcher/src/bootstrap.c @@ -31,9 +31,12 @@ static void trim(char **value) { *value = &(*value)[1]; } } -static void set_and_print_env(const char *name, char *value) { +void set_and_print_env(const char *name, char *value) { // Set Variable With No Trailing Colon - trim(&value); + static const char *unmodified_name_prefix = "MCPI_"; + if (strncmp(unmodified_name_prefix, name, strlen(unmodified_name_prefix)) != 0) { + trim(&value); + } #ifdef DEBUG // Print New Value diff --git a/launcher/src/bootstrap.h b/launcher/src/bootstrap.h index 9559fd4f..dfc8de35 100644 --- a/launcher/src/bootstrap.h +++ b/launcher/src/bootstrap.h @@ -4,6 +4,8 @@ extern "C" { #endif +void set_and_print_env(const char *name, char *value); + void bootstrap(int argc, char *argv[]); #ifdef __cplusplus diff --git a/launcher/src/client/launcher.cpp b/launcher/src/client/launcher.cpp index e4d67239..556b5a7c 100644 --- a/launcher/src/client/launcher.cpp +++ b/launcher/src/client/launcher.cpp @@ -92,7 +92,7 @@ static void run_command_and_set_env(const char *env_name, char *command[]) { output[length - 1] = '\0'; } // Set - setenv(env_name, output, 1); + set_and_print_env(env_name, output); } // Check Return Code if (return_code != 0) { diff --git a/launcher/src/server/launcher.c b/launcher/src/server/launcher.c index 6933fecf..f0cc9781 100644 --- a/launcher/src/server/launcher.c +++ b/launcher/src/server/launcher.c @@ -6,7 +6,7 @@ int main(int argc, char *argv[]) { // Set Home To Current Directory, So World Data Is Stored There char *launch_directory = getcwd(NULL, 0); - setenv("HOME", launch_directory, 1); + set_and_print_env("HOME", launch_directory); free(launch_directory); // Bootstrap