NetBSD Problem Report #43358
From root@macaran.eecs.harvard.edu Wed May 26 00:18:26 2010
Return-Path: <root@macaran.eecs.harvard.edu>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
by www.NetBSD.org (Postfix) with ESMTP id E6B8063B873
for <gnats-bugs@gnats.NetBSD.org>; Wed, 26 May 2010 00:18:25 +0000 (UTC)
Message-Id: <20100525225850.AB6526E155@macaran.eecs.harvard.edu>
Date: Tue, 25 May 2010 18:58:50 -0400 (EDT)
From: dholland@eecs.harvard.edu
Reply-To: dholland@eecs.harvard.edu
To: gnats-bugs@gnats.NetBSD.org
Subject: sort mishandles arguments
X-Send-Pr-Version: 3.95
>Number: 43358
>Category: bin
>Synopsis: sort mishandles arguments
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed May 26 00:20:00 +0000 2010
>Closed-Date: Thu May 27 05:55:37 +0000 2010
>Last-Modified: Sat Jun 05 22:40:01 +0000 2010
>Originator: David A. Holland
>Release: NetBSD 5.1_RC2
>Organization:
>Environment:
System: NetBSD macaran.eecs.harvard.edu 5.1_RC2 NetBSD 5.1_RC2 (GENERIC) #0: Fri May 21 00:29:51 UTC 2010 builds@b7.netbsd.org:/home/builds/ab/netbsd-5-1-RC2/amd64/201005210534Z-obj/home/builds/ab/netbsd-5-1-RC2/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
# echo foo > foo
# sort foo +5
sort: -k6.1: No such file or directory
#
>How-To-Repeat:
as above
>Fix:
be consistent about which arguments are options
>Release-Note:
>Audit-Trail:
From: "David A. Holland" <dholland@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/43358 CVS commit: src/usr.bin/sort
Date: Thu, 27 May 2010 05:52:29 +0000
Module Name: src
Committed By: dholland
Date: Thu May 27 05:52:29 UTC 2010
Modified Files:
src/usr.bin/sort: init.c
Log Message:
Don't recognize "+3" after -- or after the first non-option argument.
This prevents converting "+3" into "-k4.1" in places where getopt
won't recognize it, which in turn prevents silly error messages and
lossage trying to sort files whose names begin with +. PR 43358.
To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/usr.bin/sort/init.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: dholland@NetBSD.org
State-Changed-When: Thu, 27 May 2010 05:55:37 +0000
State-Changed-Why:
fixed
From: "David A. Holland" <dholland@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/43358 CVS commit: src/tests/util
Date: Sat, 5 Jun 2010 22:38:39 +0000
Module Name: src
Committed By: dholland
Date: Sat Jun 5 22:38:39 UTC 2010
Modified Files:
src/tests/util: Makefile
Added Files:
src/tests/util: t_sort.sh
Log Message:
Add a very basic test and some tests for the problem in PR 43358.
XXX: the sort tests in src/regress should be folded into this
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/util/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/util/t_sort.sh
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.