NetBSD Problem Report #37954
From wiz@hiro.nih.at Mon Feb 4 15:21:21 2008
Return-Path: <wiz@hiro.nih.at>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
by narn.NetBSD.org (Postfix) with ESMTP id 811E363B101
for <gnats-bugs@gnats.NetBSD.org>; Mon, 4 Feb 2008 15:21:21 +0000 (UTC)
Message-Id: <20080204152034.6F4B71181EE8@hiro.nih.at>
Date: Mon, 4 Feb 2008 16:20:34 +0100 (CET)
From: Thomas Klausner <wiz@NetBSD.org>
Reply-To: Thomas Klausner <wiz@NetBSD.org>
To: gnats-bugs@gnats.NetBSD.org
Subject: "tail -c 2" broken
X-Send-Pr-Version: 3.95
>Number: 37954
>Category: bin
>Synopsis: "tail -c 2" broken
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: bin-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Feb 04 15:25:00 +0000 2008
>Closed-Date: Sat Feb 16 13:00:41 +0000 2008
>Last-Modified: Sat Feb 16 13:00:41 +0000 2008
>Originator: Thomas Klausner
>Release: NetBSD 4.99.52
>Organization:
>Environment:
System: NetBSD hiro 4.99.52 NetBSD 4.99.52 (HIRO64) #2: Mon Feb 4 14:29:50 CET 2008 wiz@hiro:/usr/src/sys/arch/amd64/compile/obj/HIRO64 amd64
Architecture: x86_64
Machine: amd64
>Description:
tail -c 2 is broken. It should display the last two characters of its input.
Output on NetBSD for -c 1 to -c 3 is:
# echo -n abc | tail -c 3; echo
abc
# echo -n abc | tail -c 2; echo
b
# echo -n abc | tail -c 1; echo
c
For comparison, with tail (GNU coreutils) 5.97:
# echo -n abc | tail -c 3; echo
abc
# echo -n abc | tail -c 2; echo
bc
# echo -n abc | tail -c 1; echo
c
>How-To-Repeat:
See above.
>Fix:
>Release-Note:
>Audit-Trail:
From: Christos Zoulas <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/37954 CVS commit: src/usr.bin/tail
Date: Mon, 4 Feb 2008 16:23:11 +0000 (UTC)
Module Name: src
Committed By: christos
Date: Mon Feb 4 16:23:11 UTC 2008
Modified Files:
src/usr.bin/tail: read.c
Log Message:
PR/37954: Thomas Klausner: "tail -c 2" broken.
It is not tail -c 2 but most of tail -c <n> with pipes. Fix by Anon Ymous
To generate a diff of this commit:
cvs rdiff -r1.12 -r1.13 src/usr.bin/tail/read.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->closed
State-Changed-By: wiz@narn.netbsd.org
State-Changed-When: Sat, 16 Feb 2008 13:00:41 +0000
State-Changed-Why:
Commit fixed the problem, thanks!
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.