From 86f8ee68a47ec525aabf98ed3a30bca8ef7a4dd7 Mon Sep 17 00:00:00 2001 From: Mikhail Zakharov Date: Sun, 1 Sep 2024 12:27:30 +0200 Subject: [PATCH] `GUI-Warp.app`: `starter.c` to handle environment variables --- CHANGELOG.md | 3 ++- gui/ports/macOS/starter.c | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68184a0..4c6bd59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # CHANGELOG -* **2024.08.30 Current** +* **2024.09.01 Current** + * `GUI-Warp.app`: `starter.c` to handle environment variables * `minmiconf`: Updated to version `1.1.1.0` * `configure`: Added lost paths check for macOS SDK directories * `GUI-Warp.app`: Added an internal launcher - `starter.c` diff --git a/gui/ports/macOS/starter.c b/gui/ports/macOS/starter.c index ca62c9f..631a1b0 100644 --- a/gui/ports/macOS/starter.c +++ b/gui/ports/macOS/starter.c @@ -9,6 +9,12 @@ this stuff is worth it, you can buy me a beer in return Mikhail Zakharov */ +/* + 2024.08.29 v1.0 Initial release + 2024.09.01 v1.1 Handle environment variables + +*/ + /* -------------------------------------------------------------------------- */ #include @@ -23,6 +29,7 @@ /* -------------------------------------------------------------------------- */ int main(int argc, char *argv[]) { + extern char** environ; char buf[DIRBUFSZ]; if (argc > 2 || (argc == 2 && !strncmp(argv[1], "-h", 2))) { @@ -40,6 +47,6 @@ int main(int argc, char *argv[]) { getcwd(buf, DIRBUFSZ); sprintf(buf + strnlen(buf, DIRBUFSZ), "/%s", APP_NAME); - return execl(buf, APP_NAME, NULL); + return execle(buf, APP_NAME, 0, environ); }