aboutsummaryrefslogtreecommitdiff
path: root/coreutils/uniq.c
diff options
context:
space:
mode:
authorvda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-10-26 23:21:47 +0000
committervda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-10-26 23:21:47 +0000
commit6dc3a21627db11fa0f374afe29a6bbf4f89c8b64 (patch)
tree79166b700c497fbe798b6031e5bbff97e0933573 /coreutils/uniq.c
parent076d919b597733c0adf653d0ad10073be4adec7f (diff)
downloadbusybox-w32-6dc3a21627db11fa0f374afe29a6bbf4f89c8b64.tar.gz
busybox-w32-6dc3a21627db11fa0f374afe29a6bbf4f89c8b64.tar.bz2
busybox-w32-6dc3a21627db11fa0f374afe29a6bbf4f89c8b64.zip
remove bb_printf and the like
git-svn-id: svn://busybox.net/trunk/busybox@16446 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'coreutils/uniq.c')
-rw-r--r--coreutils/uniq.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/coreutils/uniq.c b/coreutils/uniq.c
index a7b7a8e07..100f2be00 100644
--- a/coreutils/uniq.c
+++ b/coreutils/uniq.c
@@ -37,7 +37,7 @@ int uniq_main(int argc, char **argv)
37 37
38 while ((opt = getopt(argc, argv, uniq_opts)) > 0) { 38 while ((opt = getopt(argc, argv, uniq_opts)) > 0) {
39 if ((opt == 'f') || (opt == 's')) { 39 if ((opt == 'f') || (opt == 's')) {
40 int t = xatoul(optarg); 40 unsigned long t = xatoul(optarg);
41 if (opt == 'f') { 41 if (opt == 'f') {
42 skip_fields = t; 42 skip_fields = t;
43 } else { 43 } else {
@@ -71,13 +71,13 @@ int uniq_main(int argc, char **argv)
71 /* gnu uniq ignores newlines */ 71 /* gnu uniq ignores newlines */
72 while ((s1 = xmalloc_getline(in)) != NULL) { 72 while ((s1 = xmalloc_getline(in)) != NULL) {
73 e1 = s1; 73 e1 = s1;
74 for (i=skip_fields ; i ; i--) { 74 for (i = skip_fields; i; i--) {
75 e1 = skip_whitespace(e1); 75 e1 = skip_whitespace(e1);
76 while (*e1 && !isspace(*e1)) { 76 while (*e1 && !isspace(*e1)) {
77 ++e1; 77 ++e1;
78 } 78 }
79 } 79 }
80 for (i = skip_chars ; *e1 && i ; i--) { 80 for (i = skip_chars; *e1 && i; i--) {
81 ++e1; 81 ++e1;
82 } 82 }
83 83
@@ -90,14 +90,14 @@ int uniq_main(int argc, char **argv)
90 90
91 if (s0) { 91 if (s0) {
92 if (!(uniq_flags & (2 << !!dups))) { 92 if (!(uniq_flags & (2 << !!dups))) {
93 bb_fprintf(out, "\0%d " + (uniq_flags & 1), dups + 1); 93 fprintf(out, "\0%d " + (uniq_flags & 1), dups + 1);
94 bb_fprintf(out, "%s\n", s0); 94 fprintf(out, "%s\n", s0);
95 } 95 }
96 free((void *)s0); 96 free((void *)s0);
97 } 97 }
98 } while (s1); 98 } while (s1);
99 99
100 xferror(in, input_filename); 100 die_if_ferror(in, input_filename);
101 101
102 bb_fflush_stdout_and_exit(EXIT_SUCCESS); 102 fflush_stdout_and_exit(EXIT_SUCCESS);
103} 103}