NetBSD Problem Report #40386

From mlevins@users.sourceforge.net  Tue Jan 13 12:50:50 2009
Return-Path: <mlevins@users.sourceforge.net>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id A5DC563B884
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 13 Jan 2009 12:50:50 +0000 (UTC)
Message-Id: <2615.1231850517@poultrygeist.com>
Date: Tue, 13 Jan 2009 07:42:25 -0500 (EST)
From: "M. Levinson" <mlevins@users.sourceforge.net>
Reply-To: "M. Levinson" <mlevins@users.sourceforge.net>
To: gnats-bugs@gnats.NetBSD.org
Subject: vi(1) filename completion no longer works
X-Send-Pr-Version: 3.95

>Number:         40386
>Category:       bin
>Synopsis:       vi(1) filename completion no longer works
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 13 12:55:00 +0000 2009
>Closed-Date:    Wed Mar 25 03:11:34 +0000 2009
>Last-Modified:  Wed Mar 25 03:11:34 +0000 2009
>Originator:     M. Levinson
>Release:        NetBSD 5.99.6 from 2009-01-08
>Organization:
>Environment:
     $NetBSD: ex_argv.c,v 1.2 2008/12/05 22:51:42 christos Exp $
Architecture: x86_64
Machine: amd64
>Description:
	Filename completion in vi no longer works as expected because
	revision 1.2 of dist/nvi/ex/ex_argv.c changed the name of a variable
	in argv_exp2(), probably to avoid shadowing another variable with
	the same name in the same function, but one of the renamed variable's
	three occurrences was left unchanged. As a result the wrong pointer
	is now passed to strdup(3).

>How-To-Repeat:
	Set vi's filec variable, e.g. with :set filec=<some character>.
	Type :e followed by the beginning of a filename, then the filec
	character; vi lists all of the files in its working directory
	(including non-matches, as if no filename prefix had been given).

>Fix:

--- src/dist/nvi/ex/ex_argv.c
+++ src/dist/nvi/ex/ex_argv.c
@@ -220,7 +220,7 @@ argv_exp2(SCR *sp, EXCMD *excp, const CHAR_T *cmd, size_t cmdlen)
 			*p = '\0';
 			INT2CHAR(sp, bp + SHELLOFFSET, 
 				 STRLEN(bp + SHELLOFFSET) + 1, np1, nlen);
-			d = strdup(np);
+			d = strdup(np1);
 			rval = argv_lexp(sp, excp, d);
 			free (d);
 			break;

>Release-Note:

>Audit-Trail:
From: Christos Zoulas <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/40386 CVS commit: src/dist/nvi/ex
Date: Tue, 13 Jan 2009 15:43:27 +0000 (UTC)

 Module Name:	src
 Committed By:	christos
 Date:		Tue Jan 13 15:43:27 UTC 2009

 Modified Files:
 	src/dist/nvi/ex: ex_argv.c

 Log Message:
 PR/40386: M. Levinson: vi(1) filename completion no longer works, fix bug
 introduced by shadow variable fix.


 To generate a diff of this commit:
 cvs rdiff -r1.2 -r1.3 src/dist/nvi/ex/ex_argv.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Soren Jacobsen <snj@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/40386 CVS commit: [netbsd-5] src/dist/nvi/ex
Date: Tue, 20 Jan 2009 03:02:35 +0000 (UTC)

 Module Name:	src
 Committed By:	snj
 Date:		Tue Jan 20 03:02:35 UTC 2009

 Modified Files:
 	src/dist/nvi/ex [netbsd-5]: ex_argv.c

 Log Message:
 Pull up following revision(s) (requested by lukem in ticket #292):
 	dist/nvi/ex/ex_argv.c: revision 1.3
 PR/40386: M. Levinson: vi(1) filename completion no longer works, fix bug
 introduced by shadow variable fix.


 To generate a diff of this commit:
 cvs rdiff -r1.1.1.2.6.1 -r1.1.1.2.6.2 src/dist/nvi/ex/ex_argv.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: Wed, 25 Mar 2009 03:11:34 +0000
State-Changed-Why:
fixed, thanks


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(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.