mirror of
https://github.com/stefanocasazza/ULib.git
synced 2025-09-28 19:05:55 +08:00
18 lines
307 B
C
18 lines
307 B
C
/* Public domain. */
|
|
|
|
#include "str.h"
|
|
#include "env.h"
|
|
|
|
extern /*@null@*/char *env_get(const char *s)
|
|
{
|
|
int i;
|
|
unsigned int len;
|
|
|
|
if (!s) return 0;
|
|
len = strlen(s);
|
|
for (i = 0;environ[i];++i)
|
|
if (str_start(environ[i],s) && (environ[i][len] == '='))
|
|
return environ[i] + len + 1;
|
|
return 0;
|
|
}
|