X-Git-Url: https://code.delx.au/spectrwm/blobdiff_plain/86268c60a514bdd855b2c36137b0e0501c3d3321..7e685eaa4c8a2483a9d0152f47fdb1b70d6ccfec:/spectrwm.c diff --git a/spectrwm.c b/spectrwm.c index 37b0d2e..e566741 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -3712,7 +3712,16 @@ spawn(int ws_idx, union arg *args, bool close_fd) close(xcb_get_file_descriptor(conn)); - setenv("LD_PRELOAD", SWM_LIB, 1); + if ((ret = getenv("LD_PRELOAD"))) { + if (asprintf(&ret, "%s:%s", SWM_LIB, ret) == -1) { + warn("spawn: asprintf LD_PRELOAD"); + _exit(1); + } + setenv("LD_PRELOAD", ret, 1); + free(ret); + } else { + setenv("LD_PRELOAD", SWM_LIB, 1); + } if (asprintf(&ret, "%d", ws_idx) == -1) { warn("spawn: asprintf SWM_WS");