sbase

suckless unix tools
git clone git://git.2f30.org/sbase.git
Log | Files | Refs | README | LICENSE

commit ed96a258ae4ab552faebfa4fcac7a5180ac5284d
parent f3e1a5541ed6af030cd6283b61ced12bd1cc975a
Author: Michael Forney <mforney@mforney.org>
Date:   Sun Nov  1 14:05:05 -0800

tail: Fix operation with +n argument

POSIX says

  Copying shall begin at the point in the file indicated by the -c
  number or -n number options.

  The origin for counting shall be 1; that is, -c +1 represents the
  first byte of the file, -c -1 the last.

  The origin for counting shall be 1; that is, -n +1 represents the
  first line of the file, -n -1 the last.

Diffstat:
tail.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tail.c b/tail.c @@ -18,7 +18,7 @@ dropinit(FILE *fp, const char *str, size_t n) { Rune r; char *buf = NULL; - size_t size = 0, i = 0; + size_t size = 0, i = 1; ssize_t len; if (mode == 'n') {