From e467661baf3d035fb4726559abee52a0c8897ab0 Mon Sep 17 00:00:00 2001 From: nasr Date: Tue, 6 Oct 2026 23:32:02 +0200 Subject: feature: wayland connection --- source/base/base_platform_linux.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'source/base/base_platform_linux.cpp') diff --git a/source/base/base_platform_linux.cpp b/source/base/base_platform_linux.cpp index 8fb190a..c0bf879 100644 --- a/source/base/base_platform_linux.cpp +++ b/source/base/base_platform_linux.cpp @@ -8,24 +8,22 @@ internal String8 unix_get_env(const char *var) { char *current = environ[index]; while(environ[index] != NULL) { if(CstringAnyMatch(environ[index], var)) { - String8 buffer = str8(environ[index]); + buffer = str8(environ[index]); u64 equal_sign_pos = 0; b32 found_equal_sign = str8_find(&buffer, 0, str8("="), &equal_sign_pos); if(equal_sign_pos) { - buffer = str8_chop_left(buffer, equal_sign_pos); + buffer = str8_chop_left(buffer, equal_sign_pos + 1); } - - } else { - Assert(0); - } - ++index; + return buffer; +} + ++index; } - return buffer; - + AssertLog(buffer.size != 0, "env value not found\n"); + return {0}; } -- cgit v1.3.1