Changeset 2725 in MondoRescue for branches/2.2.9/mindi-busybox/coreutils/cat.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/cat.c

    r1765 r2725  
    55 * Copyright (C) 2003  Manuel Novoa III  <mjn3@codepoet.org>
    66 *
    7  * Licensed under GPLv2, see file License in this tarball for details.
     7 * Licensed under GPLv2, see file LICENSE in this source tree.
    88 */
    99
    1010/* BB_AUDIT SUSv3 compliant */
    1111/* http://www.opengroup.org/onlinepubs/007904975/utilities/cat.html */
     12
     13//kbuild:lib-$(CONFIG_CAT)     += cat.o
     14//kbuild:lib-$(CONFIG_MORE)    += cat.o # more uses it if stdout isn't a tty
     15//kbuild:lib-$(CONFIG_LESS)    += cat.o # less too
     16//kbuild:lib-$(CONFIG_CRONTAB) += cat.o # crontab -l
     17
     18//config:config CAT
     19//config:   bool "cat"
     20//config:   default y
     21//config:   help
     22//config:     cat is used to concatenate files and print them to the standard
     23//config:     output. Enable this option if you wish to enable the 'cat' utility.
    1224
    1325#include "libbb.h"
     
    1830int bb_cat(char **argv)
    1931{
    20     static const char *const argv_dash[] = { "-", NULL };
    21 
    2232    int fd;
    2333    int retval = EXIT_SUCCESS;
    2434
    2535    if (!*argv)
    26         argv = (char**) &argv_dash;
     36        argv = (char**) &bb_argv_dash;
    2737
    2838    do {
    29         fd = STDIN_FILENO;
    30         if (!LONE_DASH(*argv))
    31             fd = open_or_warn(*argv, O_RDONLY);
     39        fd = open_or_warn_stdin(*argv);
    3240        if (fd >= 0) {
    33             /* This is not an xfunc - never exits */
     41            /* This is not a xfunc - never exits */
    3442            off_t r = bb_copyfd_eof(fd, STDOUT_FILENO);
    3543            if (fd != STDIN_FILENO)
     
    4452}
    4553
    46 int cat_main(int argc, char **argv);
    47 int cat_main(int argc, char **argv)
     54int cat_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
     55int cat_main(int argc UNUSED_PARAM, char **argv)
    4856{
    4957    getopt32(argv, "u");
Note: See TracChangeset for help on using the changeset viewer.