Skip site navigation (1)Skip section navigation (2)
Date:      Sat,  1 Dec 2001 21:00:55 -0500 (EST)
From:      kutulu <kutulu@kutulu.org>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/32433: Cannot specify files beginning with + on ee command line.
Message-ID:  <20011202020055.A8B044CA@pr0n.kutulu.org>

next in thread | raw e-mail | index | archive | help

>Number:         32433
>Category:       bin
>Synopsis:       Cannot specify files beginning with + on ee command line.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Dec 01 18:10:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     kutulu
>Release:        FreeBSD 4.4-STABLE i386
>Organization:
KutuluWare Software Services
>Environment:
System: FreeBSD pr0n.kutulu.org 4.4-STABLE FreeBSD 4.4-STABLE #1: Mon Oct 29 16:56:42 EST 2001 root@pr0n.kutulu.org:/usr/obj/usr/src/sys/PR0N i386


	
>Description:
The 'ee' command accepts a +# parameter, allowing one to jump 
immediately to a given line of the file specified on the command 
line.  This makes it impossible to edit files beginning with a +
without resorting to unusual syntax.  For ee, at least, tehre is
a simple fix for this problem.

(For the record, pico, vi, and vim also suffer from this problem,
however, vi/vim have alternate command-line options that start
with +, so the fix is not nearly as obvious).

>How-To-Repeat:

echo "This is a text file" > +CONTENTS
ee +CONTENTS

>Fix:

A work-around for this problem is to specify a pathname to the 
file that does not begin with +, as in:

ee ./+CONTENTS
ee /var/pkg/db/zip-2.3/+DESC

This perhaps should be mentioned in the 'ee' man page,
especially given the presumed target audience for ee (namely,
beginners to FreeBSD and UNIX in general.)

However, since the only valid options for the + command-lnie
paramter are digits, ee can be fixed to work the way users
probably want it to work by simply ignoring + before non-digits:

--- usr.bin/ee/ee.c.old Sat Dec  1 20:40:09 2001
+++ usr.bin/ee/ee.c     Sat Dec  1 20:41:45 2001
@@ -2094,7 +2094,8 @@
                else if (*buff == '+')
                {
                        buff++;
-                       start_at_line = buff;
+                       if isdigit(*buff)
+                               start_at_line = buff;
                }
 
                else


>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011202020055.A8B044CA>