summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/env.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/env.c b/src/env.c
index 7283926de..d95ebfd7e 100644
--- a/src/env.c
+++ b/src/env.c
@@ -1,5 +1,5 @@
/* env - run a program in a modified environment
- Copyright (C) 1986, 1991-2005 Free Software Foundation, Inc.
+ Copyright (C) 1986, 1991-2005, 2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -189,8 +189,9 @@ main (int argc, char **argv)
/* If no program is specified, print the environment and exit. */
if (argc <= optind)
{
- while (*environ)
- puts (*environ++);
+ char *const *e = environ;
+ while (*e)
+ puts (*e++);
exit (EXIT_SUCCESS);
}