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.
16 int printenv_main(int argc, char **argv)
18 extern char **environ;
21 /* no variables specified, show whole env */
26 /* search for specified variables and print them out if found */
32 for (i=1; (arg = argv[i]); ++i)
33 for (; (env = environ[e]); ++e) {
35 if (!strncmp(env, arg, l) && env[l] == '=')
40 fflush_stdout_and_exit(0);