search for: get_environment_valu

Displaying 1 result from an estimated 1 matches for "get_environment_valu".

Did you mean: get_environment_value
2001 Mar 29
3
Patches for OpenSSH 2.5.2p2: evaluate /etc/default/login, makefiles manpages
...+#endif /* ULIMIT_H */ + #ifdef WITH_IRIX_PROJECT #include <proj.h> #endif /* WITH_IRIX_PROJECT */ @@ -915,6 +919,150 @@ } #endif +/* + * Get the value to the variable 'name' in the given environment 'env'. + * If the variable isn't defined, return NULL. + */ +char *get_environment_value(char **env, const char *name) +{ + u_int i, namelen; + + namelen = strlen(name); + for (i = 0; env[i]; i++) + if (strncmp(env[i], name, namelen) == 0 && env[i][namelen] == '=') + break; + if (env[i]) + return &env[i][namelen + 1]; + else + return NULL; +} + +#define ETC_DE...