Changeset 2725 in MondoRescue for branches/2.2.9/mindi-busybox/coreutils/yes.c


Ignore:
Timestamp:
Feb 25, 2011, 9:26:54 PM (13 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.18.3 to avoid problems with the tar command which is now failing on recent versions with busybox 1.7.3
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mindi-busybox/coreutils/yes.c

    r1765 r2725  
    55 * Copyright (C) 2003  Manuel Novoa III  <mjn3@codepoet.org>
    66 *
    7  * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
     7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
    88 */
    99
     
    1919/* This is a NOFORK applet. Be very careful! */
    2020
    21 int yes_main(int argc, char **argv);
    22 int yes_main(int argc, char **argv)
     21//usage:#define yes_trivial_usage
     22//usage:       "[STRING]"
     23//usage:#define yes_full_usage "\n\n"
     24//usage:       "Repeatedly output a line with STRING, or 'y'"
     25
     26int yes_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
     27int yes_main(int argc UNUSED_PARAM, char **argv)
    2328{
    24     char **first_arg;
     29    char **pp;
    2530
    2631    argv[0] = (char*)"y";
    27     if (argc != 1) {
     32    if (argv[1])
    2833        ++argv;
    29     }
    3034
    31     first_arg = argv;
    3235    do {
     36        pp = argv;
    3337        while (1) {
    34             fputs(*argv, stdout);
    35             if (!*++argv)
     38            fputs(*pp, stdout);
     39            if (!*++pp)
    3640                break;
    3741            putchar(' ');
    3842        }
    39         argv = first_arg;
    4043    } while (putchar('\n') != EOF);
    4144
Note: See TracChangeset for help on using the changeset viewer.