Erik Andersen | e49d5ec | 2000-02-08 19:58:47 +0000 | [diff] [blame] | 1 | /* vi: set sw=4 ts=4: */ |
Erik Andersen | 3163821 | 2000-01-15 22:28:50 +0000 | [diff] [blame] | 2 | /* |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 3 | * wc implementation for busybox |
Erik Andersen | 3163821 | 2000-01-15 22:28:50 +0000 | [diff] [blame] | 4 | * |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 5 | * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org> |
Erik Andersen | 3163821 | 2000-01-15 22:28:50 +0000 | [diff] [blame] | 6 | * |
Denys Vlasenko | 0ef64bd | 2010-08-16 20:14:46 +0200 | [diff] [blame] | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
Erik Andersen | 3163821 | 2000-01-15 22:28:50 +0000 | [diff] [blame] | 8 | */ |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 9 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) |
| 10 | * |
| 11 | * Rewritten to fix a number of problems and do some size optimizations. |
Eric Andersen | c7bda1c | 2004-03-15 08:29:22 +0000 | [diff] [blame] | 12 | * Problems in the previous busybox implementation (besides bloat) included: |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 13 | * 1) broken 'wc -c' optimization (read note below) |
| 14 | * 2) broken handling of '-' args |
| 15 | * 3) no checking of ferror on EOF returns |
| 16 | * 4) isprint() wasn't considered when word counting. |
| 17 | * |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 18 | * NOTES: |
| 19 | * |
| 20 | * The previous busybox wc attempted an optimization using stat for the |
| 21 | * case of counting chars only. I omitted that because it was broken. |
| 22 | * It didn't take into account the possibility of input coming from a |
| 23 | * pipe, or input from a file with file pointer not at the beginning. |
| 24 | * |
| 25 | * To implement such a speed optimization correctly, not only do you |
| 26 | * need the size, but also the file position. Note also that the |
| 27 | * file position may be past the end of file. Consider the example |
| 28 | * (adapted from example in gnu wc.c) |
| 29 | * |
| 30 | * echo hello > /tmp/testfile && |
Denis Vlasenko | b71c668 | 2007-07-21 15:08:09 +0000 | [diff] [blame] | 31 | * (dd ibs=1k skip=1 count=0 &> /dev/null; wc -c) < /tmp/testfile |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 32 | * |
| 33 | * for which 'wc -c' should output '0'. |
| 34 | */ |
Denys Vlasenko | af3f420 | 2016-11-23 14:46:56 +0100 | [diff] [blame] | 35 | //config:config WC |
Denys Vlasenko | 4eed2c6 | 2017-07-18 22:01:24 +0200 | [diff] [blame] | 36 | //config: bool "wc (4.4 kb)" |
Denys Vlasenko | af3f420 | 2016-11-23 14:46:56 +0100 | [diff] [blame] | 37 | //config: default y |
| 38 | //config: help |
Denys Vlasenko | 72089cf | 2017-07-21 09:50:55 +0200 | [diff] [blame] | 39 | //config: wc is used to print the number of bytes, words, and lines, |
| 40 | //config: in specified files. |
Denys Vlasenko | af3f420 | 2016-11-23 14:46:56 +0100 | [diff] [blame] | 41 | //config: |
| 42 | //config:config FEATURE_WC_LARGE |
Denys Vlasenko | f560422 | 2017-01-10 14:58:54 +0100 | [diff] [blame] | 43 | //config: bool "Support very large counts" |
Denys Vlasenko | af3f420 | 2016-11-23 14:46:56 +0100 | [diff] [blame] | 44 | //config: default y |
| 45 | //config: depends on WC |
| 46 | //config: help |
Denys Vlasenko | 72089cf | 2017-07-21 09:50:55 +0200 | [diff] [blame] | 47 | //config: Use "unsigned long long" for counter variables. |
Denys Vlasenko | af3f420 | 2016-11-23 14:46:56 +0100 | [diff] [blame] | 48 | |
| 49 | //applet:IF_WC(APPLET(wc, BB_DIR_USR_BIN, BB_SUID_DROP)) |
| 50 | |
| 51 | //kbuild:lib-$(CONFIG_WC) += wc.o |
| 52 | |
| 53 | /* BB_AUDIT SUSv3 compliant. */ |
| 54 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/wc.html */ |
| 55 | |
Denis Vlasenko | b6adbf1 | 2007-05-26 19:00:18 +0000 | [diff] [blame] | 56 | #include "libbb.h" |
Denys Vlasenko | afc7b4c | 2010-10-04 17:08:14 +0200 | [diff] [blame] | 57 | #include "unicode.h" |
Erik Andersen | 3163821 | 2000-01-15 22:28:50 +0000 | [diff] [blame] | 58 | |
Denys Vlasenko | c0dab37 | 2009-10-22 22:28:08 +0200 | [diff] [blame] | 59 | #if !ENABLE_LOCALE_SUPPORT |
| 60 | # undef isprint |
| 61 | # undef isspace |
| 62 | # define isprint(c) ((unsigned)((c) - 0x20) <= (0x7e - 0x20)) |
| 63 | # define isspace(c) ((c) == ' ') |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 64 | #endif |
| 65 | |
Denis Vlasenko | 7021016 | 2006-09-29 23:41:59 +0000 | [diff] [blame] | 66 | #if ENABLE_FEATURE_WC_LARGE |
Denys Vlasenko | c0dab37 | 2009-10-22 22:28:08 +0200 | [diff] [blame] | 67 | # define COUNT_T unsigned long long |
| 68 | # define COUNT_FMT "llu" |
Denis Vlasenko | 7021016 | 2006-09-29 23:41:59 +0000 | [diff] [blame] | 69 | #else |
Denys Vlasenko | c0dab37 | 2009-10-22 22:28:08 +0200 | [diff] [blame] | 70 | # define COUNT_T unsigned |
| 71 | # define COUNT_FMT "u" |
Denis Vlasenko | 7021016 | 2006-09-29 23:41:59 +0000 | [diff] [blame] | 72 | #endif |
Denis Vlasenko | 3ed001f | 2006-09-29 23:41:04 +0000 | [diff] [blame] | 73 | |
Denys Vlasenko | afc7b4c | 2010-10-04 17:08:14 +0200 | [diff] [blame] | 74 | /* We support -m even when UNICODE_SUPPORT is off, |
| 75 | * we just don't advertise it in help text, |
| 76 | * since it is the same as -c in this case. |
| 77 | */ |
| 78 | |
| 79 | //usage:#define wc_trivial_usage |
| 80 | //usage: "[-c"IF_UNICODE_SUPPORT("m")"lwL] [FILE]..." |
| 81 | //usage: |
| 82 | //usage:#define wc_full_usage "\n\n" |
| 83 | //usage: "Count lines, words, and bytes for each FILE (or stdin)\n" |
Denys Vlasenko | afc7b4c | 2010-10-04 17:08:14 +0200 | [diff] [blame] | 84 | //usage: "\n -c Count bytes" |
| 85 | //usage: IF_UNICODE_SUPPORT( |
| 86 | //usage: "\n -m Count characters" |
| 87 | //usage: ) |
| 88 | //usage: "\n -l Count newlines" |
| 89 | //usage: "\n -w Count words" |
| 90 | //usage: "\n -L Print longest line length" |
| 91 | //usage: |
| 92 | //usage:#define wc_example_usage |
| 93 | //usage: "$ wc /etc/passwd\n" |
| 94 | //usage: " 31 46 1365 /etc/passwd\n" |
| 95 | |
| 96 | /* Order is important if we want to be compatible with |
| 97 | * column order in "wc -cmlwL" output: |
| 98 | */ |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 99 | enum { |
Denys Vlasenko | 1336f89 | 2011-01-22 17:57:01 +0100 | [diff] [blame] | 100 | WC_LINES = 0, /* -l */ |
| 101 | WC_WORDS = 1, /* -w */ |
| 102 | WC_UNICHARS = 2, /* -m */ |
| 103 | WC_BYTES = 3, /* -c */ |
| 104 | WC_LENGTH = 4, /* -L */ |
Denys Vlasenko | afc7b4c | 2010-10-04 17:08:14 +0200 | [diff] [blame] | 105 | NUM_WCS = 5, |
Glenn L McGrath | 02d090d | 2001-11-21 09:17:00 +0000 | [diff] [blame] | 106 | }; |
Erik Andersen | 3163821 | 2000-01-15 22:28:50 +0000 | [diff] [blame] | 107 | |
Denis Vlasenko | 9b49a5e | 2007-10-11 10:05:36 +0000 | [diff] [blame] | 108 | int wc_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
Denis Vlasenko | a60f84e | 2008-07-05 09:18:54 +0000 | [diff] [blame] | 109 | int wc_main(int argc UNUSED_PARAM, char **argv) |
Erik Andersen | e49d5ec | 2000-02-08 19:58:47 +0000 | [diff] [blame] | 110 | { |
Dan Fandrich | 5b0a7f1 | 2009-11-18 10:48:09 +0100 | [diff] [blame] | 111 | const char *arg; |
Denis Vlasenko | e8419c9 | 2008-02-19 00:38:10 +0000 | [diff] [blame] | 112 | const char *start_fmt = " %9"COUNT_FMT + 1; |
Denis Vlasenko | 3ed001f | 2006-09-29 23:41:04 +0000 | [diff] [blame] | 113 | const char *fname_fmt = " %s\n"; |
| 114 | COUNT_T *pcounts; |
Denys Vlasenko | 09e7daf | 2010-10-04 17:04:20 +0200 | [diff] [blame] | 115 | COUNT_T counts[NUM_WCS]; |
| 116 | COUNT_T totals[NUM_WCS]; |
Dan Fandrich | 5b0a7f1 | 2009-11-18 10:48:09 +0100 | [diff] [blame] | 117 | int num_files; |
Bernhard Reutner-Fischer | d58c194 | 2007-01-20 21:28:36 +0000 | [diff] [blame] | 118 | smallint status = EXIT_SUCCESS; |
Denis Vlasenko | 7021016 | 2006-09-29 23:41:59 +0000 | [diff] [blame] | 119 | unsigned print_type; |
Eric Andersen | c7bda1c | 2004-03-15 08:29:22 +0000 | [diff] [blame] | 120 | |
Denys Vlasenko | afc7b4c | 2010-10-04 17:08:14 +0200 | [diff] [blame] | 121 | init_unicode(); |
| 122 | |
Denys Vlasenko | 1336f89 | 2011-01-22 17:57:01 +0100 | [diff] [blame] | 123 | print_type = getopt32(argv, "lwmcL"); |
Eric Andersen | c7bda1c | 2004-03-15 08:29:22 +0000 | [diff] [blame] | 124 | |
Glenn L McGrath | 02d090d | 2001-11-21 09:17:00 +0000 | [diff] [blame] | 125 | if (print_type == 0) { |
Denys Vlasenko | 1336f89 | 2011-01-22 17:57:01 +0100 | [diff] [blame] | 126 | print_type = (1 << WC_LINES) | (1 << WC_WORDS) | (1 << WC_BYTES); |
Glenn L McGrath | 02d090d | 2001-11-21 09:17:00 +0000 | [diff] [blame] | 127 | } |
Eric Andersen | c7bda1c | 2004-03-15 08:29:22 +0000 | [diff] [blame] | 128 | |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 129 | argv += optind; |
Denis Vlasenko | 3ed001f | 2006-09-29 23:41:04 +0000 | [diff] [blame] | 130 | if (!argv[0]) { |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 131 | *--argv = (char *) bb_msg_standard_input; |
Denis Vlasenko | 3ed001f | 2006-09-29 23:41:04 +0000 | [diff] [blame] | 132 | fname_fmt = "\n"; |
Denys Vlasenko | 79950a6 | 2010-03-08 22:03:24 +0100 | [diff] [blame] | 133 | } |
| 134 | if (!argv[1]) { /* zero or one filename? */ |
Denis Vlasenko | 3ed001f | 2006-09-29 23:41:04 +0000 | [diff] [blame] | 135 | if (!((print_type-1) & print_type)) /* exactly one option? */ |
| 136 | start_fmt = "%"COUNT_FMT; |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 137 | } |
Eric Andersen | c7bda1c | 2004-03-15 08:29:22 +0000 | [diff] [blame] | 138 | |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 139 | memset(totals, 0, sizeof(totals)); |
Eric Andersen | c7bda1c | 2004-03-15 08:29:22 +0000 | [diff] [blame] | 140 | |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 141 | pcounts = counts; |
Eric Andersen | c7bda1c | 2004-03-15 08:29:22 +0000 | [diff] [blame] | 142 | |
Dan Fandrich | 5b0a7f1 | 2009-11-18 10:48:09 +0100 | [diff] [blame] | 143 | num_files = 0; |
Denys Vlasenko | 09e7daf | 2010-10-04 17:04:20 +0200 | [diff] [blame] | 144 | while ((arg = *argv++) != NULL) { |
Dan Fandrich | 5b0a7f1 | 2009-11-18 10:48:09 +0100 | [diff] [blame] | 145 | FILE *fp; |
| 146 | const char *s; |
| 147 | unsigned u; |
| 148 | unsigned linepos; |
| 149 | smallint in_word; |
| 150 | |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 151 | ++num_files; |
Denis Vlasenko | ddec5af | 2006-10-26 23:25:17 +0000 | [diff] [blame] | 152 | fp = fopen_or_warn_stdin(arg); |
Denis Vlasenko | 3ed001f | 2006-09-29 23:41:04 +0000 | [diff] [blame] | 153 | if (!fp) { |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 154 | status = EXIT_FAILURE; |
| 155 | continue; |
| 156 | } |
Eric Andersen | c7bda1c | 2004-03-15 08:29:22 +0000 | [diff] [blame] | 157 | |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 158 | memset(counts, 0, sizeof(counts)); |
| 159 | linepos = 0; |
| 160 | in_word = 0; |
Eric Andersen | c7bda1c | 2004-03-15 08:29:22 +0000 | [diff] [blame] | 161 | |
Denys Vlasenko | 09e7daf | 2010-10-04 17:04:20 +0200 | [diff] [blame] | 162 | while (1) { |
Dan Fandrich | 5b0a7f1 | 2009-11-18 10:48:09 +0100 | [diff] [blame] | 163 | int c; |
Denis Vlasenko | 7021016 | 2006-09-29 23:41:59 +0000 | [diff] [blame] | 164 | /* Our -w doesn't match GNU wc exactly... oh well */ |
| 165 | |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 166 | c = getc(fp); |
Dan Fandrich | 5b0a7f1 | 2009-11-18 10:48:09 +0100 | [diff] [blame] | 167 | if (c == EOF) { |
| 168 | if (ferror(fp)) { |
| 169 | bb_simple_perror_msg(arg); |
| 170 | status = EXIT_FAILURE; |
| 171 | } |
Denys Vlasenko | fb132e4 | 2010-10-29 11:46:52 +0200 | [diff] [blame] | 172 | goto DO_EOF; /* Treat an EOF as '\r'. */ |
Dan Fandrich | 5b0a7f1 | 2009-11-18 10:48:09 +0100 | [diff] [blame] | 173 | } |
Denys Vlasenko | 09e7daf | 2010-10-04 17:04:20 +0200 | [diff] [blame] | 174 | |
Denys Vlasenko | afc7b4c | 2010-10-04 17:08:14 +0200 | [diff] [blame] | 175 | /* Cater for -c and -m */ |
Denys Vlasenko | 1336f89 | 2011-01-22 17:57:01 +0100 | [diff] [blame] | 176 | ++counts[WC_BYTES]; |
Denys Vlasenko | afc7b4c | 2010-10-04 17:08:14 +0200 | [diff] [blame] | 177 | if (unicode_status != UNICODE_ON /* every byte is a new char */ |
| 178 | || (c & 0xc0) != 0x80 /* it isn't a 2nd+ byte of a Unicode char */ |
| 179 | ) { |
| 180 | ++counts[WC_UNICHARS]; |
| 181 | } |
| 182 | |
| 183 | if (isprint_asciionly(c)) { /* FIXME: not unicode-aware */ |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 184 | ++linepos; |
Denys Vlasenko | c0dab37 | 2009-10-22 22:28:08 +0200 | [diff] [blame] | 185 | if (!isspace(c)) { |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 186 | in_word = 1; |
| 187 | continue; |
| 188 | } |
Denys Vlasenko | c0dab37 | 2009-10-22 22:28:08 +0200 | [diff] [blame] | 189 | } else if ((unsigned)(c - 9) <= 4) { |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 190 | /* \t 9 |
| 191 | * \n 10 |
| 192 | * \v 11 |
| 193 | * \f 12 |
| 194 | * \r 13 |
| 195 | */ |
| 196 | if (c == '\t') { |
| 197 | linepos = (linepos | 7) + 1; |
Denys Vlasenko | fb132e4 | 2010-10-29 11:46:52 +0200 | [diff] [blame] | 198 | } else { /* '\n', '\r', '\f', or '\v' */ |
Dan Fandrich | 5b0a7f1 | 2009-11-18 10:48:09 +0100 | [diff] [blame] | 199 | DO_EOF: |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 200 | if (linepos > counts[WC_LENGTH]) { |
| 201 | counts[WC_LENGTH] = linepos; |
| 202 | } |
| 203 | if (c == '\n') { |
| 204 | ++counts[WC_LINES]; |
| 205 | } |
| 206 | if (c != '\v') { |
| 207 | linepos = 0; |
| 208 | } |
| 209 | } |
Glenn L McGrath | 74afa9a | 2001-11-21 10:26:28 +0000 | [diff] [blame] | 210 | } else { |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 211 | continue; |
Glenn L McGrath | 74afa9a | 2001-11-21 10:26:28 +0000 | [diff] [blame] | 212 | } |
Eric Andersen | c7bda1c | 2004-03-15 08:29:22 +0000 | [diff] [blame] | 213 | |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 214 | counts[WC_WORDS] += in_word; |
| 215 | in_word = 0; |
| 216 | if (c == EOF) { |
| 217 | break; |
| 218 | } |
Denys Vlasenko | 09e7daf | 2010-10-04 17:04:20 +0200 | [diff] [blame] | 219 | } |
| 220 | |
| 221 | fclose_if_not_stdin(fp); |
Eric Andersen | c7bda1c | 2004-03-15 08:29:22 +0000 | [diff] [blame] | 222 | |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 223 | if (totals[WC_LENGTH] < counts[WC_LENGTH]) { |
| 224 | totals[WC_LENGTH] = counts[WC_LENGTH]; |
Glenn L McGrath | 9e6c9f7 | 2001-11-21 12:46:36 +0000 | [diff] [blame] | 225 | } |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 226 | totals[WC_LENGTH] -= counts[WC_LENGTH]; |
Eric Andersen | c7bda1c | 2004-03-15 08:29:22 +0000 | [diff] [blame] | 227 | |
Dan Fandrich | 5b0a7f1 | 2009-11-18 10:48:09 +0100 | [diff] [blame] | 228 | OUTPUT: |
Denis Vlasenko | 3ed001f | 2006-09-29 23:41:04 +0000 | [diff] [blame] | 229 | /* coreutils wc tries hard to print pretty columns |
Denys Vlasenko | 09e7daf | 2010-10-04 17:04:20 +0200 | [diff] [blame] | 230 | * (saves results for all files, finds max col len etc...) |
Denis Vlasenko | 3ed001f | 2006-09-29 23:41:04 +0000 | [diff] [blame] | 231 | * we won't try that hard, it will bloat us too much */ |
| 232 | s = start_fmt; |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 233 | u = 0; |
| 234 | do { |
| 235 | if (print_type & (1 << u)) { |
Denis Vlasenko | f0ed376 | 2006-10-26 23:21:47 +0000 | [diff] [blame] | 236 | printf(s, pcounts[u]); |
Denis Vlasenko | 3ed001f | 2006-09-29 23:41:04 +0000 | [diff] [blame] | 237 | s = " %9"COUNT_FMT; /* Ok... restore the leading space. */ |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 238 | } |
| 239 | totals[u] += pcounts[u]; |
Denys Vlasenko | 09e7daf | 2010-10-04 17:04:20 +0200 | [diff] [blame] | 240 | } while (++u < NUM_WCS); |
Denis Vlasenko | f0ed376 | 2006-10-26 23:21:47 +0000 | [diff] [blame] | 241 | printf(fname_fmt, arg); |
Denis Vlasenko | 3ed001f | 2006-09-29 23:41:04 +0000 | [diff] [blame] | 242 | } |
Eric Andersen | c7bda1c | 2004-03-15 08:29:22 +0000 | [diff] [blame] | 243 | |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 244 | /* If more than one file was processed, we want the totals. To save some |
| 245 | * space, we set the pcounts ptr to the totals array. This has the side |
| 246 | * effect of trashing the totals array after outputting it, but that's |
| 247 | * irrelavent since we no longer need it. */ |
| 248 | if (num_files > 1) { |
Denys Vlasenko | fb132e4 | 2010-10-29 11:46:52 +0200 | [diff] [blame] | 249 | num_files = 0; /* Make sure we don't get here again. */ |
Denis Vlasenko | 3ed001f | 2006-09-29 23:41:04 +0000 | [diff] [blame] | 250 | arg = "total"; |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 251 | pcounts = totals; |
Denis Vlasenko | 3ed001f | 2006-09-29 23:41:04 +0000 | [diff] [blame] | 252 | --argv; |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 253 | goto OUTPUT; |
Mark Whitley | 3950596 | 2000-07-20 00:08:10 +0000 | [diff] [blame] | 254 | } |
Eric Andersen | c7bda1c | 2004-03-15 08:29:22 +0000 | [diff] [blame] | 255 | |
Denis Vlasenko | f0ed376 | 2006-10-26 23:21:47 +0000 | [diff] [blame] | 256 | fflush_stdout_and_exit(status); |
Erik Andersen | 3163821 | 2000-01-15 22:28:50 +0000 | [diff] [blame] | 257 | } |