1 /* vi: set sw=4 ts=4: */
3 * printenv implementation for busybox
5 * Copyright (C) 2005 by Erik Andersen <andersen@codepoet.org>
6 * Copyright (C) 2005 by Mike Frysinger <vapier@gentoo.org>
8 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
12 extern char **environ
;
14 int printenv_main(int argc
, char **argv
);
15 int printenv_main(int argc
, char **argv
)
19 /* no variables specified, show whole env */
24 /* search for specified variables and print them out if found */
30 for (i
=1; (arg
= argv
[i
]); ++i
)
31 for (; (env
= environ
[e
]); ++e
) {
33 if (!strncmp(env
, arg
, l
) && env
[l
] == '=')
38 fflush_stdout_and_exit(0);