Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Apr 2003 01:40:14 -0700 (PDT)
From:      Peter Pentchev <roam@ringlet.net>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/51488: Compat patch: more(1) allowed filename to start with '+'
Message-ID:  <200304290840.h3T8eEwf057403@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/51488; it has been noted by GNATS.

From: Peter Pentchev <roam@ringlet.net>
To: Dmitry Sivachenko <mitya@cavia.pp.ru>
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



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