ignore more variables
[buildroot.git] / toolchain / dependencies / env.c
blob4303100b0f58b78af5d2161313182fec0b32d74c
1 /* print the current environment to track eventually changed settings.
3 * Copyright (C) 2008 Bernhard Fischer
5 * Licensed under GPLv2 or later, see
6 * http://www.gnu.org/licenses/gpl.txt
7 */
8 #include <unistd.h>
9 #include <stdio.h>
10 #include <string.h>
11 extern char **environ;
13 static const char skip[] =
14 "_=\0SSH_CLIENT=\0SSH_TTY=\0SSH_CONNECTION=\0DISPLAY=\0";
15 int main(void)
17 char **envp;
18 int ret = 0;
19 for (envp = environ; *envp; envp++) {
20 unsigned ok = 1;
21 const char *str = skip;
22 while (str) {
23 size_t len = strlen(str);
24 if (!len)
25 break;
26 if (!strncmp(str, envp[0], len)) {
27 ok = 0;
28 break;
30 str += ++len;
32 if (!ok)
33 continue;
34 if (puts(*envp) <= 0) {
35 ret = 1;
36 break;
39 return ret;