mirror of
https://github.com/libretro/cpp-cheat.git
synced 2025-04-10 23:40:49 +00:00
25 lines
434 B
C
25 lines
434 B
C
/*
|
|
# environ
|
|
|
|
Automatically set by POSIX libraries linked to.
|
|
|
|
List of strings of type `VAR=val`.
|
|
*/
|
|
|
|
#include "common.h"
|
|
|
|
int main(void) {
|
|
/* Print entire environment. */
|
|
extern char **environ;
|
|
char **env = environ;
|
|
char *s = "HOME=";
|
|
while (*env) {
|
|
if (!strncmp(*env, s, strlen(s))) {
|
|
printf("%s\n", *env);
|
|
break;
|
|
}
|
|
env++;
|
|
}
|
|
return EXIT_SUCCESS;
|
|
}
|