aboutsummaryrefslogtreecommitdiff
path: root/archive/extras.c.txt
diff options
context:
space:
mode:
Diffstat (limited to 'archive/extras.c.txt')
-rw-r--r--archive/extras.c.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/archive/extras.c.txt b/archive/extras.c.txt
new file mode 100644
index 0000000..beb48d9
--- /dev/null
+++ b/archive/extras.c.txt
@@ -0,0 +1,11 @@
+// useless file.
+
+cstr getenv(cstr name) {
+ extern cstr *environ;
+ size_t len = lenstr(name);
+ for (char **e = environ; *e; e++) {
+ if (safe_cmp(*e, name, len) && (*e)[len] == '=')
+ return *e + len + 1;
+ }
+ return NULL;
+} \ No newline at end of file