Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/coreutils/printenv.c
- Timestamp:
- Jan 1, 2014, 12:47:38 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mindi-busybox/coreutils/printenv.c
r2725 r3232 8 8 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 9 9 */ 10 11 //usage:#define printenv_trivial_usage 12 //usage: "[VARIABLE]..." 13 //usage:#define printenv_full_usage "\n\n" 14 //usage: "Print environment VARIABLEs.\n" 15 //usage: "If no VARIABLE specified, print all." 10 16 11 17 #include "libbb.h" … … 20 26 /* no variables specified, show whole env */ 21 27 if (!argv[1]) { 22 int e = 0; 23 while (environ[e]) 24 puts(environ[e++]); 28 char **e = environ; 29 30 /* environ can be NULL! (for example, after clearenv()) 31 * Check for that: 32 */ 33 if (e) 34 while (*e) 35 puts(*e++); 25 36 } else { 26 37 /* search for specified variables and print them out if found */
Note:
See TracChangeset
for help on using the changeset viewer.