NetBSD Problem Report #26046

Received: (qmail 9652 invoked by uid 605); 24 Jun 2004 22:15:36 -0000
Message-Id: <20040624221532.B44362BCF9@home.mewburn.net>
Date: Fri, 25 Jun 2004 08:15:32 +1000 (EST)
From: lukem@NetBSD.org
Sender: gnats-bugs-owner@NetBSD.org
Reply-To: lukem@NetBSD.org
To: gnats-bugs@gnats.NetBSD.org
Subject: vi filename completion bugs
X-Send-Pr-Version: 3.95

>Number:         26046
>Category:       bin
>Synopsis:       vi filename completion bugs
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jun 24 22:16:01 +0000 2004
>Closed-Date:    
>Last-Modified:  Wed Sep 20 21:12:37 +0000 2017
>Originator:     Luke Mewburn
>Release:        NetBSD 2.0C
>Organization:
The NetBSD Foundation
>Environment:
System: NetBSD argo 2.0C NetBSD 2.0C (LUKEM_SERVER from GENERIC-$Revision: 1.594 $) #0: Fri Apr 9 00:54:52 EST 2004 lukem@argo:/var/obj/i386/usr/src/sys/arch/i386/compile/LUKEM_SERVER i386
Architecture: i386
Machine: i386
>Description:
	vi supports filename completion, which I set to the <tab> key with:
		set filec=\<tab>

	However, certain characters in filenames are "special" to vi 
	and should be escaped in the "completed" name in the buffer.
	These characters include: %, #, and whitespace.

>How-To-Repeat:
	% mkdir testdir
	% cd testdir
	% touch 'test1' 'foo%bar' 'gee#wiz' 'hello there' 'tab<tab>here'
	% setenv EXINIT 'set filec=\<tab>'

	% vi
	:e te<tab>
	" expands to 'test1', opens as 'test1'
	" This is ok.
	:q

	% vi
	:e fo<tab>
	" expands to 'foo%bar', opens as 'foo/tmp/vi.09127bbar'
	" The expansion should be 'foo\%bar' so that the correct file is opened.
	:q

	% vi
	:e ge<tab>
	" expands to 'gee#wiz', vi errors with
	"	No filename to substitute for #.
	" The expansion should be 'gee\#wiz' so that the correct file is opened.
	:q

	% vi
	:e he<tab>
	" expands to 'hello there', vi errors with:
	"	Usage: [Ee][dit][!] [+cmd] [file].
	" It is not clear how to :e a file with a space in the name.
	:q

	% vi
	:e ta<tab>
	" expands to 'tab<tab>here', vi errors with:
	"	Usage: [Ee][dit][!] [+cmd] [file].
	" It is not clear how to :e a file with a tab in the name.
	:q


>Fix:
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: bin-bug-people->aymeric 
Responsible-Changed-By: aymeric 
Responsible-Changed-When: Fri Jun 25 11:27:26 UTC 2004 
Responsible-Changed-Why:  
I'm responsible for vi 
From: Aymeric Vincent <aymeric@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: PR/26046 CVS commit: src/usr.bin/vi/ex
Date: Tue,  6 Sep 2005 21:50:52 +0000 (UTC)

 Module Name:	src
 Committed By:	aymeric
 Date:		Tue Sep  6 21:50:52 UTC 2005

 Modified Files:
 	src/usr.bin/vi/ex: ex_argv.c

 Log Message:
 In argv_exp3() where we cut a line into args, check for '\' as the escape
 character instead of using the IS_ESCAPE() macro which tests for ^V because the
 former is mandated by the standards, and the latter is insane.
 This is a very small part in addressing PR bin/26046 by lukem@.
 Before, in order to escape a special character, you had to use a literal ^V,
 which is type ^V twice before the character; whereas now, you use \.
 Because the fix will remain partial for a while, you have to remove \ from
 your shellmeta option otherwise the \ is swallowed by the invoked shell that
 handles arguments expansion.
 Please complain if you want ^V^V to also work, but please don't call me a
 heretic.


 To generate a diff of this commit:
 cvs rdiff -r1.13 -r1.14 src/usr.bin/vi/ex/ex_argv.c

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

From: Matthias Scheler <tron@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: PR/26046 CVS commit: [netbsd-3] src/usr.bin/vi/ex
Date: Fri,  9 Sep 2005 15:01:44 +0000 (UTC)

 Module Name:	src
 Committed By:	tron
 Date:		Fri Sep  9 15:01:44 UTC 2005

 Modified Files:
 	src/usr.bin/vi/ex [netbsd-3]: ex_argv.c

 Log Message:
 Pull up following revision(s) (requested by aymeric in ticket #753):
 	usr.bin/vi/ex/ex_argv.c: revision 1.14
 In argv_exp3() where we cut a line into args, check for '\' as the escape
 character instead of using the IS_ESCAPE() macro which tests for ^V because the
 former is mandated by the standards, and the latter is insane.
 This is a very small part in addressing PR bin/26046 by lukem@.
 Before, in order to escape a special character, you had to use a literal ^V,
 which is type ^V twice before the character; whereas now, you use \.
 Because the fix will remain partial for a while, you have to remove \ from
 your shellmeta option otherwise the \ is swallowed by the invoked shell that
 handles arguments expansion.
 Please complain if you want ^V^V to also work, but please don't call me a
 heretic.


 To generate a diff of this commit:
 cvs rdiff -r1.12.2.1 -r1.12.2.2 src/usr.bin/vi/ex/ex_argv.c

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

Responsible-Changed-From-To: aymeric->bin-bug-people
Responsible-Changed-By: spz@NetBSD.org
Responsible-Changed-When: Wed, 20 Sep 2017 21:12:37 +0000
Responsible-Changed-Why:
aymeric resigned


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