Changeset 2725 in MondoRescue for branches/2.2.9/mindi-busybox/coreutils/catv.c
- Timestamp:
- Feb 25, 2011, 9:26:54 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mindi-busybox/coreutils/catv.c
r1765 r2725 5 5 * Copyright (C) 2006 Rob Landley <rob@landley.net> 6 6 * 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. 8 8 */ 9 9 … … 13 13 #include "libbb.h" 14 14 15 int catv_main(int argc, char **argv) ;16 int catv_main(int argc , char **argv)15 int catv_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 16 int catv_main(int argc UNUSED_PARAM, char **argv) 17 17 { 18 18 int retval = EXIT_SUCCESS; … … 28 28 29 29 /* Read from stdin if there's nothing else to do. */ 30 fd = 0; 31 if (!argv[0]) { 32 argv--; 33 goto jump_in; 34 } 30 if (!argv[0]) 31 *--argv = (char*)"-"; 35 32 do { 36 fd = open_or_warn (*argv, O_RDONLY);33 fd = open_or_warn_stdin(*argv); 37 34 if (fd < 0) { 38 35 retval = EXIT_FAILURE; 39 36 continue; 40 37 } 41 jump_in:42 38 for (;;) { 43 39 int i, res; … … 63 59 if (c == 10) { 64 60 if (flags & CATV_OPT_e) 65 putchar('$');61 bb_putchar('$'); 66 62 } else if (flags & (c==9 ? CATV_OPT_t : CATV_OPT_v)) { 67 63 printf("^%c", c+'@'); … … 69 65 } 70 66 } 71 putchar(c);67 bb_putchar(c); 72 68 } 73 69 }
Note:
See TracChangeset
for help on using the changeset viewer.