From 5ae85f2426a6e2a7ade2c8c686d5371d1b715ba4 Mon Sep 17 00:00:00 2001 From: cracyc Date: Mon, 18 Jun 2018 15:29:36 -0400 Subject: [PATCH] Use OS2PATH instead of Ryan's hardcoded hack. --- lib2ine.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib2ine.c b/lib2ine.c index dc7a569..dbdb677 100644 --- a/lib2ine.c +++ b/lib2ine.c @@ -150,12 +150,13 @@ static void initPib(void) char **envp = environ; - const char *default_os2path = "PATH=C:\\home\\icculus\\Dropbox\\emx\\bin;C:\\WATCOM\\binp;C:\\home\\icculus"; // !!! FIXME: noooooope. + char path[255]; + snprintf(path, 254, "PATH=%s", getenv("OS2PATH")); for (int i = 0; envp[i]; i++) { const char *str = envp[i]; if (strncmp(str, "PATH=", 5) == 0) { if (!GLoaderState.subprocess) - str = default_os2path; + str = path; } else if (strncmp(str, "IS_2INE=", 8) == 0) { continue; } // if @@ -184,7 +185,7 @@ static void initPib(void) const char *str = envp[i]; if (strncmp(str, "PATH=", 5) == 0) { if (!GLoaderState.subprocess) - str = default_os2path; + str = path; } else if (strncmp(str, "LIBPATH=", 8) == 0) { libpath = str + 8; } else if (strncmp(str, "IS_2INE=", 8) == 0) {