summaryrefslogtreecommitdiff
path: root/source/base/base_platform_linux.cpp
diff options
context:
space:
mode:
authornasr <nsrddyn@gmail.com>2026-10-06 23:32:02 +0200
committernasr <nsrddyn@gmail.com>2026-10-06 23:32:02 +0200
commite467661baf3d035fb4726559abee52a0c8897ab0 (patch)
treef51bb6caf00a6bde1234fb58cd1285891fe4b4e6 /source/base/base_platform_linux.cpp
parentf6d3090f7fa76eb8e0dbe060b8490cb49c001c39 (diff)
feature: wayland connection
Diffstat (limited to 'source/base/base_platform_linux.cpp')
-rw-r--r--source/base/base_platform_linux.cpp16
1 files changed, 7 insertions, 9 deletions
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) {
8 char *current = environ[index]; 8 char *current = environ[index];
9 while(environ[index] != NULL) { 9 while(environ[index] != NULL) {
10 if(CstringAnyMatch(environ[index], var)) { 10 if(CstringAnyMatch(environ[index], var)) {
11 String8 buffer = str8(environ[index]); 11 buffer = str8(environ[index]);
12 12
13 u64 equal_sign_pos = 0; 13 u64 equal_sign_pos = 0;
14 b32 found_equal_sign = str8_find(&buffer, 0, str8("="), &equal_sign_pos); 14 b32 found_equal_sign = str8_find(&buffer, 0, str8("="), &equal_sign_pos);
15 15
16 if(equal_sign_pos) { 16 if(equal_sign_pos) {
17 buffer = str8_chop_left(buffer, equal_sign_pos); 17 buffer = str8_chop_left(buffer, equal_sign_pos + 1);
18 } 18 }
19 19
20 20 return buffer;
21 } else { 21}
22 Assert(0); 22 ++index;
23 }
24 ++index;
25 } 23 }
26 return buffer;
27
28 24
25 AssertLog(buffer.size != 0, "env value not found\n");
26 return {0};
29} 27}
30 28
31 29