diff options
author | Jim Meyering <jim@meyering.net> | 2003-05-11 06:32:47 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2003-05-11 06:32:47 +0000 |
commit | 92f900fdf3830288d10a008eac4ee5d569cc5b19 (patch) | |
tree | bfce27ea1e5f215fd666740b40a4bcfe3ab434f2 /src | |
parent | 6a0019aa786634a9cfb8a5a84c3d155cddef8102 (diff) | |
download | coreutils-92f900fdf3830288d10a008eac4ee5d569cc5b19.tar.xz |
(main): Handle argc < optind.
Diffstat (limited to 'src')
-rw-r--r-- | src/printenv.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/printenv.c b/src/printenv.c index 89472ff8d..73c431fe6 100644 --- a/src/printenv.c +++ b/src/printenv.c @@ -1,5 +1,5 @@ /* printenv -- print all or part of environment - Copyright (C) 1989-1997, 1999-2002 Free Software Foundation, Inc. + Copyright (C) 1989-1997, 1999-2003 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 @@ -107,7 +107,7 @@ main (int argc, char **argv) } } - if (optind == argc) + if (optind >= argc) { for (env = environ; *env != NULL; ++env) puts (*env); |