From owner-freebsd-bugs Wed Aug 9 17:30:02 1995 Return-Path: bugs-owner Received: (from majordom@localhost) by freefall.FreeBSD.org (8.6.11/8.6.6) id RAA06284 for bugs-outgoing; Wed, 9 Aug 1995 17:30:02 -0700 Received: (from gnats@localhost) by freefall.FreeBSD.org (8.6.11/8.6.6) id RAA06275 ; Wed, 9 Aug 1995 17:30:02 -0700 Resent-Date: Wed, 9 Aug 1995 17:30:02 -0700 Resent-Message-Id: <199508100030.RAA06275@freefall.FreeBSD.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.freebsd.org, fenner@parc.xerox.com Received: from alpha.xerox.com (alpha.Xerox.COM [13.1.64.93]) by freefall.FreeBSD.org (8.6.11/8.6.6) with SMTP id RAA05914 for ; Wed, 9 Aug 1995 17:26:31 -0700 Received: from baobab.parc.xerox.com ([13.2.116.113]) by alpha.xerox.com with SMTP id <17778(6)>; Wed, 9 Aug 1995 17:25:53 PDT Received: (from fenner@localhost) by baobab.parc.xerox.com (8.6.11/8.6.9) id RAA11259; Wed, 9 Aug 1995 17:43:09 -0700 Message-Id: <199508100043.RAA11259@baobab.parc.xerox.com> Date: Wed, 9 Aug 1995 17:43:09 PDT From: Bill Fenner Reply-To: fenner@parc.xerox.com To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/669: csh doesn't allow !-2* Sender: bugs-owner@freebsd.org Precedence: bulk >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: