]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(main): Handle argc < optind.
authorJim Meyering <jim@meyering.net>
Sun, 11 May 2003 06:32:47 +0000 (06:32 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 11 May 2003 06:32:47 +0000 (06:32 +0000)
src/printenv.c

index 89472ff8dce3e437ae727ff6f31f1d6e4265afd4..73c431fe66d42f1efa580de11b65ec85a6f9b8e3 100644 (file)
@@ -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);