From: Jim Meyering Date: Sun, 11 May 2003 06:32:47 +0000 (+0000) Subject: (main): Handle argc < optind. X-Git-Tag: v5.0.1~528 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=92f900fdf3830288d10a008eac4ee5d569cc5b19;p=thirdparty%2Fcoreutils.git (main): Handle argc < optind. --- diff --git a/src/printenv.c b/src/printenv.c index 89472ff8dc..73c431fe66 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);