diff -Nru buthead-1.0/buthead.1 buthead-1.1/buthead.1 --- buthead-1.0/buthead.1 2001-06-26 07:20:06.000000000 +0000 +++ buthead-1.1/buthead.1 2011-09-26 21:16:24.000000000 +0000 @@ -1,32 +1,34 @@ -.TH BUTHEAD 1 "April 1, 1988" -.UC +.TH BUTHEAD "1" "April 1" "buthead (latzutils)" "User Commands" .SH NAME buthead \- copies all but the first few lines .SH SYNOPSIS +.BI buthead \ count +.br +.BI bh \ count +.SH EXAMPLES .B buthead -count -.SH EXAMPLE +5 file\-without\-header +.br +seq 5 | .B buthead -5 file-without-header +3 .SH DESCRIPTION -.I Buthead +.B Buthead copies all but the first .I count -lines of the standard input to the standard output. +lines of stdin to stdout. .SH DIAGNOSTICS -.I Buthead -terminates gracefully if EOF is encountered within the first +Terminates gracefully if EOF encountered within first .I count lines. .SH AUTHOR -Written by Barak A. Pearlmutter at Carnegie-Mellon University -on April 1, 1988. +Written by Barak A. Pearlmutter on April 1. .SH BUGS -The -.I buttail -program still needs to be written. - Functionality overlaps with -.I tail +count +.BI tail\ \-n\ + count +or +.BI awk\ '(NR> count )' +or +.BI sed\ 1, count d .SH SEE\ ALSO -head(1), tail(1) +head(1), tail(1), sed(1) diff -Nru buthead-1.0/buthead.c buthead-1.1/buthead.c --- buthead-1.0/buthead.c 2001-06-26 09:11:45.000000000 +0000 +++ buthead-1.1/buthead.c 2011-09-26 21:16:24.000000000 +0000 @@ -1,6 +1,6 @@ -// buthead: pass through all but the first n lines of standard input. +// buthead: pass through all but first n lines of standard input -// Copyright (C) 2001, Barak A. Pearlmutter +// Copyright 2002, Barak A. Pearlmutter // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -8,35 +8,36 @@ // (at your option) any later version. #include +#include +#include -int main(argc,argv) - int argc; - char **argv; +int main(int argc, char **argv) { - int lines_to_skip, c, i; - - if (argc != 2) - { - fprintf(stderr, "Usage: %s count.\n", argv[0]); - exit(2); - } - - if (sscanf(argv[1], "%d", &lines_to_skip) != 1 || lines_to_skip < 0) - { - fprintf(stderr, "Unable to parse line count %s.\n", argv[1]); - exit(2); + long lines_to_skip, i; + int c; + char *p; + + if (argc != 2) { + fprintf(stderr, "Usage: %s count\n", argv[0]); + exit(2); + } + + lines_to_skip = strtol(argv[1], &p, 10); + + if (errno || lines_to_skip < 0 || argv[1][0] == '\0' || *p != '\0') { + fprintf(stderr, "buthead error: invalid line count '%s'\n", argv[1]); + exit(2); + } + + for (i=0; i Mon, 26 Sep 2011 22:32:36 +0100 + buthead (1.0-16) unstable; urgency=low * bump debian standards diff -Nru buthead-1.0/debian/compat buthead-1.1/debian/compat --- buthead-1.0/debian/compat 2010-03-23 14:17:57.000000000 +0000 +++ buthead-1.1/debian/compat 2011-09-26 21:20:44.000000000 +0000 @@ -1 +1 @@ -7 +8 diff -Nru buthead-1.0/debian/control buthead-1.1/debian/control --- buthead-1.0/debian/control 2010-03-23 14:17:57.000000000 +0000 +++ buthead-1.1/debian/control 2011-09-26 21:20:44.000000000 +0000 @@ -2,8 +2,8 @@ Section: text Priority: extra Maintainer: Barak A. Pearlmutter -Standards-Version: 3.8.4 -Build-depends: debhelper (>= 7.2.5) +Standards-Version: 3.9.2 +Build-depends: debhelper (>= 8) Vcs-Git: git://git.debian.org/git/collab-maint/buthead.git Vcs-Browser: http://git.debian.org/?p=collab-maint/buthead.git diff -Nru buthead-1.0/debian/patches/debian-changes-1.0-16 buthead-1.1/debian/patches/debian-changes-1.0-16 --- buthead-1.0/debian/patches/debian-changes-1.0-16 2010-04-06 12:52:04.000000000 +0000 +++ buthead-1.1/debian/patches/debian-changes-1.0-16 1970-01-01 00:00:00.000000000 +0000 @@ -1,179 +0,0 @@ -Description: Upstream changes introduced in version 1.0-16 - This patch has been created by dpkg-source during the package build. - Here's the last changelog entry, hopefully it gives details on why - those changes were made: - . - buthead (1.0-16) unstable; urgency=low - . - * bump debian standards - * switch to dpkg-source 3.0 (quilt) format - . - The person named in the Author field signed this changelog entry. -Author: Barak A. Pearlmutter - ---- -The information above should follow the Patch Tagging Guidelines, please -checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here -are templates for supplementary fields that you might want to add: - -Origin: , -Bug: -Bug-Debian: http://bugs.debian.org/ -Forwarded: -Reviewed-By: -Last-Update: - ---- buthead-1.0.orig/buthead.c -+++ buthead-1.0/buthead.c -@@ -1,6 +1,6 @@ --// buthead: pass through all but the first n lines of standard input. -+// buthead: pass through all but first n lines of standard input - --// Copyright (C) 2001, Barak A. Pearlmutter -+// Copyright 2002, Barak A. Pearlmutter - - // This program is free software; you can redistribute it and/or modify - // it under the terms of the GNU General Public License as published by -@@ -8,35 +8,36 @@ - // (at your option) any later version. - - #include -+#include -+#include - --int main(argc,argv) -- int argc; -- char **argv; -+int main(int argc, char **argv) - { -- int lines_to_skip, c, i; -- -- if (argc != 2) -- { -- fprintf(stderr, "Usage: %s count.\n", argv[0]); -- exit(2); -- } -- -- if (sscanf(argv[1], "%d", &lines_to_skip) != 1 || lines_to_skip < 0) -- { -- fprintf(stderr, "Unable to parse line count %s.\n", argv[1]); -- exit(2); -+ long lines_to_skip, i; -+ int c; -+ char *p; -+ -+ if (argc != 2) { -+ fprintf(stderr, "Usage: %s count\n", argv[0]); -+ exit(2); -+ } -+ -+ lines_to_skip = strtol(argv[1], &p, 10); -+ -+ if (errno || lines_to_skip < 0 || argv[1][0] == '\0' || *p != '\0') { -+ fprintf(stderr, "buthead error: invalid line count '%s'\n", argv[1]); -+ exit(2); -+ } -+ -+ for (i=0; ifile\-without\-header -+.br -+seq 5 | - .B buthead --5 file-without-header -+3 - .SH DESCRIPTION --.I Buthead -+.B Buthead - copies all but the first - .I count --lines of the standard input to the standard output. -+lines of stdin to stdout. - .SH DIAGNOSTICS --.I Buthead --terminates gracefully if EOF is encountered within the first -+Terminates gracefully if EOF encountered within first - .I count - lines. - .SH AUTHOR --Written by Barak A. Pearlmutter at Carnegie-Mellon University --on April 1, 1988. -+Written by Barak A. Pearlmutter on April 1. - .SH BUGS --The --.I buttail --program still needs to be written. -- - Functionality overlaps with --.I tail +count -+.BI tail\ \-n\ + count -+or -+.BI awk\ '(NR> count )' -+or -+.BI sed\ 1, count d - .SH SEE\ ALSO --head(1), tail(1) -+head(1), tail(1), sed(1) diff -Nru buthead-1.0/debian/patches/series buthead-1.1/debian/patches/series --- buthead-1.0/debian/patches/series 2010-04-06 12:52:04.000000000 +0000 +++ buthead-1.1/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -debian-changes-1.0-16 diff -Nru buthead-1.0/debian/rules buthead-1.1/debian/rules --- buthead-1.0/debian/rules 2010-03-23 14:17:57.000000000 +0000 +++ buthead-1.1/debian/rules 2011-09-26 21:20:44.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/make -f %: - dh $@ + dh $@ --parallel override_dh_auto_install: dh_auto_install -- prefix=/usr diff -Nru buthead-1.0/.gitignore buthead-1.1/.gitignore --- buthead-1.0/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ buthead-1.1/.gitignore 2011-09-26 21:16:24.000000000 +0000 @@ -0,0 +1 @@ +/buthead diff -Nru buthead-1.0/Makefile.randomuselesscrap buthead-1.1/Makefile.randomuselesscrap --- buthead-1.0/Makefile.randomuselesscrap 2001-06-26 06:59:00.000000000 +0000 +++ buthead-1.1/Makefile.randomuselesscrap 2011-09-26 21:16:24.000000000 +0000 @@ -1,5 +1,7 @@ +# -*- Makefile -*- +progs=buthead clean: - -rm -f buthead + -rm -f $(progs) prefix=/usr/local exec_prefix=$(prefix) @@ -9,12 +11,12 @@ INSTALL_PROGRAM = $(INSTALL) --mode a+rx,ug+w INSTALL_DIR = mkdir --parent -install:: buthead +install:: $(progs) $(INSTALL_DIR) $(DESTDIR)$(bindir) - $(INSTALL_PROGRAM) buthead $(DESTDIR)$(bindir) + $(INSTALL_PROGRAM) $(progs) $(DESTDIR)$(bindir) uninstall:: - -cd $(DESTDIR)$(bindir); rm -f buthead + -cd $(DESTDIR)$(bindir) && rm -f $(progs) install-strip: $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) --strip' install