bin/51488: Compat patch: more(1) allowed filename to start with '+'
Dmitry Sivachenko
mitya at cavia.pp.ru
Mon Apr 28 03:50:19 PDT 2003
>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 at 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:
More information about the freebsd-bugs
mailing list