Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Aug 1995 17:43:09 PDT
From:      Bill Fenner <fenner@parc.xerox.com>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/669: csh doesn't allow !-2*
Message-ID:  <199508100043.RAA11259@baobab.parc.xerox.com>
Resent-Message-ID: <199508100030.RAA06275@freefall.FreeBSD.org>

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

>Number:         669
>Category:       bin
>Synopsis:       csh doesn't allow !-2*
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug  9 17:30:01 PDT 1995
>Last-Modified:
>Originator:     Bill Fenner
>Organization:
Xerox PARC
>Release:        FreeBSD 2.0-BUILT-19950527 i386
>Environment:

	

>Description:

	

csh doesn't allow the full history syntax documented in the man page.  The
man page says:

     The `:' separating the event specification from the word designator can
     be omitted if the argument selector begins with a `^', `$', `*' `-' or
     `%'.

However,

% echo !-2*
2*: Event not found.


>How-To-Repeat:

	

Use any of the argument selectors ^, *, - or % after a history command that
is not !!

>Fix:
	
	
Note, I didn't take the time to gain a deep understanding of the code, but
this fixes the immediate problem.  I don't know if it creates new problems.
Someone who knows csh internals (is there anyone left?) might want to review
it to be absolutely sure.

--- bin/csh/lex.c.orig	Tue May 30 00:06:35 1995
+++ bin/csh/lex.c	Thu Aug 10 00:08:22 1995
@@ -1187,7 +1187,7 @@
 	    }
 	    np = lhsb;
 	    event = 0;
-	    while (!cmap(c, _ESC | _META | _QF | _QB) && !any("${}:", c)) {
+	    while (!cmap(c, _ESC | _META | _QF | _QB) && !any("^$*-%{}:", c)) {
 		if (event != -1 && Isdigit(c))
 		    event = event * 10 + c - '0';
 		else
>Audit-Trail:
>Unformatted:



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