diff options
| author | Kyle Brenneman <kbrenneman@nvidia.com> | 2024-09-17 17:27:37 -0600 |
|---|---|---|
| committer | Daniel Stone <daniels@collabora.com> | 2025-09-15 14:45:53 +0100 |
| commit | 77730f10a0eaac1c654d1bdc689783292bdb5f2d (patch) | |
| tree | efd3d2d8d37534f519f49d5971168782befbdf16 /src/wayland-client.c | |
| parent | cursor: Free theme when size check fails to avoid memory leak (diff) | |
| download | wayland-77730f10a0eaac1c654d1bdc689783292bdb5f2d.tar wayland-77730f10a0eaac1c654d1bdc689783292bdb5f2d.tar.gz wayland-77730f10a0eaac1c654d1bdc689783292bdb5f2d.tar.bz2 wayland-77730f10a0eaac1c654d1bdc689783292bdb5f2d.tar.lz wayland-77730f10a0eaac1c654d1bdc689783292bdb5f2d.tar.xz wayland-77730f10a0eaac1c654d1bdc689783292bdb5f2d.tar.zst wayland-77730f10a0eaac1c654d1bdc689783292bdb5f2d.zip | |
connection: Add a function to parse WAYLAND_DEBUG tokens
Add a new function, wl_check_env_token, to scan for a token in a
comma-separated string.
Change wl_display_create in wayland-server.c and
wl_display_connect_to_fd in wayland-client.c to use that instead of a
simple substring search.
This means that WAYLAND_DEBUG will accept a value like "client,server"
but not "clientserver". But, this will make it easier to add other
tokens without worrying about overlap between them.
Signed-off-by: Kyle Brenneman <kbrenneman@nvidia.com>
Diffstat (limited to 'src/wayland-client.c')
| -rw-r--r-- | src/wayland-client.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wayland-client.c b/src/wayland-client.c index c863304..c0b361f 100644 --- a/src/wayland-client.c +++ b/src/wayland-client.c @@ -1236,7 +1236,7 @@ wl_display_connect_to_fd(int fd) no_color = getenv("NO_COLOR"); force_color = getenv("FORCE_COLOR"); debug = getenv("WAYLAND_DEBUG"); - if (debug && (strstr(debug, "client") || strstr(debug, "1"))) { + if (debug && (wl_check_env_token(debug, "client") || wl_check_env_token(debug, "1"))) { debug_client = 1; if (isatty(fileno(stderr))) debug_color = 1; |
