From owner-freebsd-bugs@FreeBSD.ORG Tue Apr 29 01:40:15 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4299D37B401 for ; Tue, 29 Apr 2003 01:40:15 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id DB23A43F75 for ; Tue, 29 Apr 2003 01:40:14 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h3T8eEUp057409 for ; Tue, 29 Apr 2003 01:40:14 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h3T8eEwf057403; Tue, 29 Apr 2003 01:40:14 -0700 (PDT) Date: Tue, 29 Apr 2003 01:40:14 -0700 (PDT) Message-Id: <200304290840.h3T8eEwf057403@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Peter Pentchev Subject: Re: bin/51488: Compat patch: more(1) allowed filename to start with '+' X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Peter Pentchev List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2003 08:40:15 -0000 The following reply was made to PR bin/51488; it has been noted by GNATS. From: Peter Pentchev To: Dmitry Sivachenko Cc: bug-followup@FreeBSD.org Subject: Re: bin/51488: Compat patch: more(1) allowed filename to start with '+' Date: Tue, 29 Apr 2003 11:29:32 +0300 On Mon, Apr 28, 2003 at 02:44:04PM +0400, Dmitry Sivachenko wrote: > > >Number: 51488 > >Category: bin > >Synopsis: Compat patch: more(1) allowed filename to start with '+' > >Originator: Dmitry Sivachenko > >Release: FreeBSD 4.8-STABLE i386 > >Description: > more(1), before it became an alias to less(1), allowed filename to start with > '+'. Thus, `more +abc` was legal request to view file '+abc'. > less(1) treats leading '+' symbol specially. The following patch > restores old behaviour (only when invoked as 'more'). > >Fix: > --- main.c.orig Mon Apr 28 14:36:38 2003 > +++ main.c Mon Apr 28 14:38:21 2003 > @@ -125,7 +125,8 @@ > if (s != NULL) > scan_option(save(s)); > > -#define isoptstring(s) (((s)[0] == '-' || (s)[0] == '+') && (s)[1] != '\0') > +#define isoptstring(s) more_mode ? (((s)[0] == '-') && (s)[1] != '\0') : \ > + (((s)[0] == '-' || (s)[0] == '+') && (s)[1] != '\0') > while (argc > 0 && (isoptstring(*argv) || isoptpending())) > { > s = *argv++; Just a minor style/correctness comment: IMHO, the ?: conditional should be enclosed in another set of parentheses. Other than that, this looks great! G'luck, Peter -- Peter Pentchev roam@ringlet.net roam@sbnd.net roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 The rest of this sentence is written in Thailand, on