delete now unused check_header_gzip.c
[oweals/busybox.git] / coreutils / uniq.c
index bcdf44026dde46e2189239d0a8daadf717669b02..719bbb5e3c673efbcf087085fd1bd265b0528442 100644 (file)
@@ -10,9 +10,9 @@
 /* BB_AUDIT SUSv3 compliant */
 /* http://www.opengroup.org/onlinepubs/007904975/utilities/uniq.html */
 
-#include "busybox.h"
+#include "libbb.h"
 
-static const char uniq_opts[] = "cdu" "f:s:" "cdu\0\1\2\4";
+static const char uniq_opts[] ALIGN1 = "cdu" "f:s:" "cdu\0\1\2\4";
 
 static FILE *xgetoptfile_uniq_s(char **argv, int read0write2)
 {
@@ -45,7 +45,7 @@ int uniq_main(int argc, char **argv)
 
        skip_fields = skip_chars = 0;
 
-       opt = getopt32(argc, argv, "cduf:s:", &s0, &s1);
+       opt = getopt32(argv, "cduf:s:", &s0, &s1);
        if (opt & OPT_f)
                skip_fields = xatoul(s0);
        if (opt & OPT_s)
@@ -75,9 +75,7 @@ int uniq_main(int argc, char **argv)
                        e1 = s1;
                        for (i = skip_fields; i; i--) {
                                e1 = skip_whitespace(e1);
-                               while (*e1 && !isspace(*e1)) {
-                                       ++e1;
-                               }
+                               e1 = skip_non_whitespace(e1);
                        }
                        for (i = skip_chars; *e1 && i; i--) {
                                ++e1;