fix(venus): drop LIBGL_KOPPER_DISABLE without calling the guarded unsetenv (#2441)

This commit is contained in:
Kurt Himebauch authored and GitHub committed 2026-11-11 20:55:41 -05:00
1 parent 8961d088f2
commit a7bd6ed299
2 files changed
+74 -1

No files matched your search

+8 -1
View File
@@ -12,7 +12,14 @@
#include <stdlib.h>
#include <string.h>
extern char **environ;
__attribute__((constructor)) static void bl_venus_keep_kopper(void) {
static const char name[] = "LIBGL_KOPPER_DISABLE=";
const char *debug = getenv("VN_DEBUG");
if (debug && strstr(debug, "vtest")) unsetenv("LIBGL_KOPPER_DISABLE");
if (!debug || !strstr(debug, "vtest") || !environ) return;
char **out = environ;
for (char **in = environ; *in; in++)
if (strncmp(*in, name, sizeof name - 1)) *out++ = *in;
*out = NULL;
}