X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=head.c;h=0c8ef3d5907b8f020b90a7780c964fe281c4e905;hb=8a9b2c6448e32f16e4b65dbd4927d9108c007acc;hp=6e05eded543977eb55d226631af35373c1bc319b;hpb=1fa1adea2ae16d4f4c82d7466905dce4c6edd5f5;p=oweals%2Fbusybox.git diff --git a/head.c b/head.c index 6e05eded5..0c8ef3d59 100644 --- a/head.c +++ b/head.c @@ -3,7 +3,7 @@ * Mini head implementation for busybox * * - * Copyright (C) 1999,2000 by Lineo, inc. + * Copyright (C) 1999,2000,2001 by Lineo, inc. * Written by John Beppu * * This program is free software; you can redistribute it and/or modify @@ -22,11 +22,14 @@ * */ -#include "busybox.h" #include #include +#include +#include +#include +#include "busybox.h" -int head(int len, FILE *fp) +static int head(int len, FILE *fp) { int i; char *input; @@ -55,7 +58,7 @@ int head_main(int argc, char **argv) break; /* fallthrough */ default: - usage(head_usage); + show_usage(); } } @@ -76,7 +79,7 @@ int head_main(int argc, char **argv) } if (fp) { if (need_headers) { - fprintf(stdout, "==> %s <==\n", argv[optind]); + printf("==> %s <==\n", argv[optind]); } head(len, fp); if (errno) { @@ -85,7 +88,7 @@ int head_main(int argc, char **argv) errno = 0; } if (optind < argc - 1) - fprintf(stdout, "\n"); + putchar('\n'); if (fp != stdin) fclose(fp); }