Date: Mon, 28 Apr 2003 14:44:04 +0400 (MSD) From: Dmitry Sivachenko <mitya@cavia.pp.ru> To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/51488: Compat patch: more(1) allowed filename to start with '+' Message-ID: <200304281044.h3SAi4j1000341@tear.demos.su> Resent-Message-ID: <200304281050.h3SAoHXx079059@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 51488 >Category: bin >Synopsis: Compat patch: more(1) allowed filename to start with '+' >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: Mon Apr 28 03:50:14 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Dmitry Sivachenko >Release: FreeBSD 4.8-STABLE i386 >Organization: >Environment: System: FreeBSD tear.demos.su 4.8-STABLE FreeBSD 4.8-STABLE #2: Mon Apr 28 14:27:07 MSD 2003 mitya@tear.demos.su:/usr/src/sys/compile/TEAR 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'). >How-To-Repeat: >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++; >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200304281044.h3SAi4j1000341>