mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-08-12 20:09:14 +02:00
(main): Handle argc < optind.
This commit is contained in:
+2
-2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user