Ignore:
Timestamp:
Jan 1, 2014, 12:47:38 AM (10 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.21.1
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi-busybox/coreutils/printenv.c

    r2725 r3232  
    88 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
    99 */
     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."
    1016
    1117#include "libbb.h"
     
    2026    /* no variables specified, show whole env */
    2127    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++);
    2536    } else {
    2637        /* search for specified variables and print them out if found */
Note: See TracChangeset for help on using the changeset viewer.