This commit was generated by cvs2svn to compensate for changes in r172468,

which included commits to RCS files with non-trunk default branches.
This commit is contained in:
Xin LI 2007-10-08 16:14:52 +00:00
commit e62cd27f64
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=172469
16 changed files with 117 additions and 12 deletions

View File

@ -13,6 +13,18 @@
======================================================================
Major changes between "less" versions 406 and 408
* Support CSI escape sequences, like SGR escape sequences.
* Fix bug which caused screen to fail to repaint when window is resized.
* Fix bug in using -i and -I flags with non-ASCII text.
* Fix configure bug on systems which don't support langinfo.h.
======================================================================
Major changes between "less" versions 394 and 406
* Allow decimal point in number for % (percent) command.

View File

@ -1,7 +1,7 @@
Less, version 406
Less, version 408
This is the distribution of less, version 406, released 19 Jun 2007.
This is the distribution of less, version 408, released 01 Oct 2007.
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

@ -128,6 +128,9 @@ fch_get()
POSITION pos;
POSITION len;
if (thisfile == NULL)
return (EOI);
slept = FALSE;
/*
@ -416,6 +419,9 @@ ch_seek(pos)
BLOCKNUM new_block;
POSITION len;
if (thisfile == NULL)
return (0);
len = ch_length();
if (pos < ch_zero() || (len != NULL_POSITION && pos > len))
return (1);
@ -450,6 +456,9 @@ ch_end_seek()
{
POSITION len;
if (thisfile == NULL)
return (0);
if (ch_flags & CH_CANSEEK)
ch_fsize = filesize(ch_file);
@ -503,6 +512,8 @@ ch_beg_seek()
public POSITION
ch_length()
{
if (thisfile == NULL)
return (NULL_POSITION);
if (ignore_eoi)
return (NULL_POSITION);
if (ch_flags & CH_HELPFILE)
@ -516,6 +527,8 @@ ch_length()
public POSITION
ch_tell()
{
if (thisfile == NULL)
return (NULL_POSITION);
return (ch_block * LBUFSIZE) + ch_offset;
}
@ -527,6 +540,8 @@ ch_forw_get()
{
register int c;
if (thisfile == NULL)
return (EOI);
c = ch_get();
if (c == EOI)
return (EOI);
@ -546,6 +561,8 @@ ch_forw_get()
public int
ch_back_get()
{
if (thisfile == NULL)
return (EOI);
if (ch_offset > 0)
ch_offset --;
else
@ -586,6 +603,9 @@ ch_flush()
{
register struct buf *bp;
if (thisfile == NULL)
return;
if (!(ch_flags & CH_CANSEEK))
{
/*
@ -769,6 +789,9 @@ ch_close()
{
int keepstate = FALSE;
if (thisfile == NULL)
return;
if (ch_flags & (CH_CANSEEK|CH_POPENED|CH_HELPFILE))
{
/*
@ -807,6 +830,8 @@ ch_close()
public int
ch_getflags()
{
if (thisfile == NULL)
return (0);
return (ch_flags);
}

View File

@ -567,24 +567,29 @@ get_wchar(p)
{
case 1:
default:
/* 0xxxxxxx */
return (LWCHAR)
(p[0] & 0xFF);
case 2:
/* 110xxxxx 10xxxxxx */
return (LWCHAR) (
((p[0] & 0x1F) << 6) |
(p[1] & 0x3F));
case 3:
/* 1110xxxx 10xxxxxx 10xxxxxx */
return (LWCHAR) (
((p[0] & 0x0F) << 12) |
((p[1] & 0x3F) << 6) |
(p[2] & 0x3F));
case 4:
/* 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */
return (LWCHAR) (
((p[0] & 0x07) << 18) |
((p[1] & 0x3F) << 12) |
((p[2] & 0x3F) << 6) |
(p[3] & 0x3F));
case 5:
/* 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx */
return (LWCHAR) (
((p[0] & 0x03) << 24) |
((p[1] & 0x3F) << 18) |
@ -592,6 +597,7 @@ get_wchar(p)
((p[3] & 0x3F) << 6) |
(p[4] & 0x3F));
case 6:
/* 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx */
return (LWCHAR) (
((p[0] & 0x01) << 30) |
((p[1] & 0x3F) << 24) |
@ -602,6 +608,56 @@ get_wchar(p)
}
}
/*
* Store a character into a UTF-8 string.
*/
public void
put_wchar(pp, ch)
char **pp;
LWCHAR ch;
{
if (!utf_mode || ch < 0x80)
{
/* 0xxxxxxx */
*(*pp)++ = (char) ch;
} else if (ch < 0x800)
{
/* 110xxxxx 10xxxxxx */
*(*pp)++ = (char) (0xC0 | ((ch >> 6) & 0x1F));
*(*pp)++ = (char) (0x80 | (ch & 0x3F));
} else if (ch < 0x10000)
{
/* 1110xxxx 10xxxxxx 10xxxxxx */
*(*pp)++ = (char) (0xE0 | ((ch >> 12) & 0x0F));
*(*pp)++ = (char) (0x80 | ((ch >> 6) & 0x3F));
*(*pp)++ = (char) (0x80 | (ch & 0x3F));
} else if (ch < 0x200000)
{
/* 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */
*(*pp)++ = (char) (0xF0 | ((ch >> 18) & 0x07));
*(*pp)++ = (char) (0x80 | ((ch >> 12) & 0x3F));
*(*pp)++ = (char) (0x80 | ((ch >> 6) & 0x3F));
*(*pp)++ = (char) (0x80 | (ch & 0x3F));
} else if (ch < 0x4000000)
{
/* 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx */
*(*pp)++ = (char) (0xF0 | ((ch >> 24) & 0x03));
*(*pp)++ = (char) (0x80 | ((ch >> 18) & 0x3F));
*(*pp)++ = (char) (0x80 | ((ch >> 12) & 0x3F));
*(*pp)++ = (char) (0x80 | ((ch >> 6) & 0x3F));
*(*pp)++ = (char) (0x80 | (ch & 0x3F));
} else
{
/* 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx */
*(*pp)++ = (char) (0xF0 | ((ch >> 30) & 0x01));
*(*pp)++ = (char) (0x80 | ((ch >> 24) & 0x3F));
*(*pp)++ = (char) (0x80 | ((ch >> 18) & 0x3F));
*(*pp)++ = (char) (0x80 | ((ch >> 12) & 0x3F));
*(*pp)++ = (char) (0x80 | ((ch >> 6) & 0x3F));
*(*pp)++ = (char) (0x80 | (ch & 0x3F));
}
}
/*
* Step forward or backward one character in a string.
*/

View File

@ -6473,6 +6473,7 @@ cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <locale.h>
#include <ctype.h>
#include <langinfo.h>
int
main ()
{

View File

@ -304,7 +304,8 @@ fi
AC_MSG_CHECKING(for locale)
AC_TRY_LINK([#include <locale.h>
#include <ctype.h>], [setlocale(LC_CTYPE,""); isprint(0); iscntrl(0);],
#include <ctype.h>
#include <langinfo.h>], [setlocale(LC_CTYPE,""); isprint(0); iscntrl(0);],
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_LOCALE)], [AC_MSG_RESULT(no)])
AC_MSG_CHECKING(for ctype functions)
AC_TRY_LINK([

View File

@ -482,7 +482,7 @@ bin_file(f)
for (i = 0; i < n; i++)
{
char c = data[i];
if (ctldisp == OPT_ONPLUS && c == ESC)
if (ctldisp == OPT_ONPLUS && IS_CSI_START(c))
{
while (++i < n && is_ansi_middle(data[i]))
continue;

View File

@ -56,6 +56,7 @@
public int utf_len ();
public int is_utf8_well_formed ();
public LWCHAR get_wchar ();
public void put_wchar ();
public LWCHAR step_char ();
public int is_composing_char ();
public int is_ubin_char ();

View File

@ -31,6 +31,7 @@ extern int top_scroll;
jump_forw()
{
POSITION pos;
POSITION end_pos;
if (ch_end_seek())
{
@ -42,11 +43,17 @@ jump_forw()
* Go back one line from the end of the file
* to get to the beginning of the last line.
*/
pos = back_line(ch_tell());
pos_clear();
end_pos = ch_tell();
pos = back_line(end_pos);
if (pos == NULL_POSITION)
jump_loc((POSITION)0, sc_height-1);
else
{
jump_loc(pos, sc_height-1);
if (position(sc_height-1) != end_pos)
repaint();
}
}
/*

View File

@ -1544,4 +1544,4 @@ LESS(1) LESS(1)
Version 406: 19 Jun 2007 LESS(1)
Version 408: 01 Oct 2007 LESS(1)

View File

@ -1,4 +1,4 @@
.TH LESS 1 "Version 406: 19 Jun 2007"
.TH LESS 1 "Version 408: 01 Oct 2007"
.SH NAME
less \- opposite of more
.SH SYNOPSIS

View File

@ -46,4 +46,4 @@ LESSECHO(1) LESSECHO(1)
Version 406: 19 Jun 2007 LESSECHO(1)
Version 408: 01 Oct 2007 LESSECHO(1)

View File

@ -1,4 +1,4 @@
.TH LESSECHO 1 "Version 406: 19 Jun 2007"
.TH LESSECHO 1 "Version 408: 01 Oct 2007"
.SH NAME
lessecho \- expand metacharacters
.SH SYNOPSIS

View File

@ -357,4 +357,4 @@ LESSKEY(1) LESSKEY(1)
Version 406: 19 Jun 2007 LESSKEY(1)
Version 408: 01 Oct 2007 LESSKEY(1)

View File

@ -1,4 +1,4 @@
.TH LESSKEY 1 "Version 406: 19 Jun 2007"
.TH LESSKEY 1 "Version 408: 01 Oct 2007"
.SH NAME
lesskey \- specify key bindings for less
.SH SYNOPSIS

View File

@ -693,6 +693,8 @@ v403 5/25/07 Fix Windows build.
v404 6/5/07 Fix display bug with F command and long lines.
v405 6/17/07 Fix display bug when using -w option.
v406 6/17/07 Fix secure build.
v407 8/16/07 Fix bugs; support CSI chars.
v408 10/1/07 Fix bug in -i with non-ASCII chars.
*/
char version[] = "406";
char version[] = "408";