Vendor import of less v458.

This commit is contained in:
Xin LI 2013-05-13 05:27:43 +00:00
parent fcf6d6d329
commit 368ca3013f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/vendor/less/dist/; revision=250590
svn path=/vendor/less/v458/; revision=250591; tag=vendor/less/v458
14 changed files with 492 additions and 457 deletions

7
NEWS
View File

@ -11,9 +11,10 @@
======================================================================
Major changes between "less" versions 451 and 456
Major changes between "less" versions 451 and 458
* Allow backslash escaping of metacharacters in LESS environment variable.
* Allow backslash escaping of metacharacters in LESS environment variable
after the --use-backslash option.
* Don't quit if syntax errors are found in command line options.
@ -25,6 +26,8 @@
* Fix Win32 attribute display bug.
* Fix display bug when using up/down arrow on the command line.
======================================================================
Major changes between "less" versions 444 and 451

4
README
View File

@ -1,7 +1,7 @@
Less, version 456
Less, version 458
This is the distribution of less, version 456, released 08 Nov 2012.
This is the distribution of less, version 458, released 04 Apr 2013.
This program is part of the GNU project (http://www.gnu.org).
This program is free software. You may redistribute it and/or

View File

@ -727,9 +727,9 @@ cmd_updown(action)
s = ml->string;
if (s == NULL)
s = "";
strcpy(cmdbuf, s);
cmd_home();
clear_eol();
strcpy(cmdbuf, s);
for (cp = cmdbuf; *cp != '\0'; )
cmd_right();
return (CC_OK);

2
help.c
View File

@ -110,7 +110,7 @@ constant char helpdata[] = {
' ',' ',' ',' ',' ',' ',' ',' ','M','o','s','t',' ','o','p','t','i','o','n','s',' ','m','a','y',' ','b','e',' ','c','h','a','n','g','e','d',' ','e','i','t','h','e','r',' ','o','n',' ','t','h','e',' ','c','o','m','m','a','n','d',' ','l','i','n','e',',','\n',
' ',' ',' ',' ',' ',' ',' ',' ','o','r',' ','f','r','o','m',' ','w','i','t','h','i','n',' ','l','e','s','s',' ','b','y',' ','u','s','i','n','g',' ','t','h','e',' ','-',' ','o','r',' ','-','-',' ','c','o','m','m','a','n','d','.','\n',
' ',' ',' ',' ',' ',' ',' ',' ','O','p','t','i','o','n','s',' ','m','a','y',' ','b','e',' ','g','i','v','e','n',' ','i','n',' ','o','n','e',' ','o','f',' ','t','w','o',' ','f','o','r','m','s',':',' ','e','i','t','h','e','r',' ','a',' ','s','i','n','g','l','e','\n',
' ',' ',' ',' ',' ',' ',' ',' ','c','h','a','r','a','c','t','e','r',' ','p','r','e','c','e','d','e','d',' ','b','y',' ','a',' ','-',',',' ','o','r',' ','a',' ','n','a','m','e',' ','p','r','e','c','e','e','d','e','d',' ','b','y',' ','-','-','.','\n',
' ',' ',' ',' ',' ',' ',' ',' ','c','h','a','r','a','c','t','e','r',' ','p','r','e','c','e','d','e','d',' ','b','y',' ','a',' ','-',',',' ','o','r',' ','a',' ','n','a','m','e',' ','p','r','e','c','e','d','e','d',' ','b','y',' ','-','-','.','\n',
'\n',
' ',' ','-','?',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','h','e','l','p','\n',
' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','i','s','p','l','a','y',' ','h','e','l','p',' ','(','f','r','o','m',' ','c','o','m','m','a','n','d',' ','l','i','n','e',')','.','\n',

View File

@ -107,7 +107,7 @@
Most options may be changed either on the command line,
or from within less by using the - or -- command.
Options may be given in one of two forms: either a single
character preceded by a -, or a name preceeded by --.
character preceded by a -, or a name preceded by --.
-? ........ --help
Display help (from command line).

874
less.man

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
.TH LESS 1 "Version 456: 08 Nov 2012"
.TH LESS 1 "Version 458: 04 Apr 2013"
.SH NAME
less \- opposite of more
.SH SYNOPSIS
@ -461,8 +461,12 @@ For example, you can set two \-D options on MS-DOS like this:
.sp
LESS="Dn9.1$Ds4.1"
.sp
A dollar sign or backslash may be included literally in an option string
If the --use-backslash option appears earlier in the options, then
a dollar sign or backslash may be included literally in an option string
by preceding it with a backslash.
If the --use-backslash option is not in effect, then backslashes are
not treated specially, and there is no way to include a dollar sign
in the option string.
.IP "\-? or \-\-help"
This option displays a summary of the commands accepted by
.I less
@ -891,11 +895,6 @@ If the number is specified as a fraction, the actual number of
scroll positions is recalculated if the terminal window is resized,
so that the actual scroll remains at the specified fraction
of the screen width.
.IP "\-\-no-keypad"
Disables sending the keypad initialization and deinitialization strings
to the terminal.
This is sometimes useful if the keypad strings make the numeric
keypad behave in an undesirable manner.
.IP "\-\-follow-name"
Normally, if the input file is renamed while an F command is executing,
.I less
@ -909,6 +908,16 @@ If the reopen succeeds and the file is a different file from the original
with the same name as the original (now renamed) file),
.I less
will display the contents of that new file.
.IP "\-\-no-keypad"
Disables sending the keypad initialization and deinitialization strings
to the terminal.
This is sometimes useful if the keypad strings make the numeric
keypad behave in an undesirable manner.
.IP "\-\-use-backslash"
This option changes the interpretations of options which follow this one.
After the \-\-use-backslash option, any backslash in an option string is
removed and the following character is taken literally.
This allows a dollar sign to be included in option strings.
.IP \-\-
A command line argument of "\-\-" marks the end of option arguments.
Any arguments following this are interpreted as filenames.

View File

@ -51,4 +51,4 @@ LESSECHO(1) LESSECHO(1)
Version 456: 08 Nov 2012 LESSECHO(1)
Version 458: 04 Apr 2013 LESSECHO(1)

View File

@ -1,4 +1,4 @@
.TH LESSECHO 1 "Version 456: 08 Nov 2012"
.TH LESSECHO 1 "Version 458: 04 Apr 2013"
.SH NAME
lessecho \- expand metacharacters
.SH SYNOPSIS

View File

@ -353,4 +353,4 @@ LESSKEY(1) LESSKEY(1)
Version 456: 08 Nov 2012 LESSKEY(1)
Version 458: 04 Apr 2013 LESSKEY(1)

View File

@ -1,4 +1,4 @@
.TH LESSKEY 1 "Version 456: 08 Nov 2012"
.TH LESSKEY 1 "Version 458: 04 Apr 2013"
.SH NAME
lesskey \- specify key bindings for less
.SH SYNOPSIS

View File

@ -30,6 +30,7 @@ extern int screen_trashed;
extern int less_is_more;
extern int quit_at_eof;
extern char *every_first_cmd;
extern int opt_use_backslash;
/*
* Return a printable description of an option.
@ -578,7 +579,7 @@ optstring(s, p_str, printopt, validchars)
for (p = s; *p != '\0'; p++)
{
if (*p == '\\' && p[1] != '\0')
if (opt_use_backslash && *p == '\\' && p[1] != '\0')
{
/* Take next char literally. */
++p;

View File

@ -52,6 +52,7 @@ public int use_lessopen; /* Use the LESSOPEN filter */
public int quit_on_intr; /* Quit on interrupt */
public int follow_mode; /* F cmd Follows file desc or file name? */
public int oldbot; /* Old bottom of screen behavior {{REMOVE}} */
public int opt_use_backslash; /* Use backslash escaping in option parsing */
#if HILITE_SEARCH
public int hilite_search; /* Highlight matched search patterns? */
#endif
@ -115,6 +116,7 @@ static struct optname pound_optname = { "shift", NULL };
static struct optname keypad_optname = { "no-keypad", NULL };
static struct optname oldbot_optname = { "old-bot", NULL };
static struct optname follow_optname = { "follow-name", NULL };
static struct optname use_backslash_optname = { "use-backslash", NULL };
/*
@ -446,6 +448,14 @@ static struct loption option[] =
NULL
}
},
{ OLETTER_NONE, &use_backslash_optname,
BOOL, OPT_OFF, &opt_use_backslash, NULL,
{
"Use backslash escaping in command line parameters",
"Don't use backslash escaping in command line parameters",
NULL
}
},
{ '\0', NULL, NOVAR, 0, NULL, NULL, { NULL, NULL, NULL } }
};

View File

@ -754,12 +754,14 @@ v449 6/23/12 Allow config option --with-regex=none.
v450 7/4/12 Fix EOF bug with ESC-F.
v451 7/20/12 Fix typo.
-----------------------------------------------------------------
v452 10/19/12 Fix --with-regex=none, fix "stty 0", fix Win32.
v452 10/19/12 Fix --with-regex=none, fix "stty 0", fix Win32.
Don't quit if errors in cmd line options.
v453 10/27/12 Increase buffer sizes.
v454 11/5/12 Fix typo.
v455 11/5/12 Fix typo.
v456 11/8/12 Fix option string incompatibility.
v453 10/27/12 Increase buffer sizes.
v454 11/5/12 Fix typo.
v455 11/5/12 Fix typo.
v456 11/8/12 Fix option string incompatibility.
v457 12/8/12 Use new option string syntax only after --use-backslash.
v458 4/4/13 Fix display bug in using up/down in cmd buffer.
*/
char version[] = "456";
char version[] = "458";