This commit was generated by cvs2svn to compensate for changes in r173682,
which included commits to RCS files with non-trunk default branches.
This commit is contained in:
commit
e82bf08b85
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=173683
@ -2,7 +2,7 @@
|
||||
------------
|
||||
|
||||
Less
|
||||
Copyright (C) 1984-2005 Mark Nudelman
|
||||
Copyright (C) 1984-2007 Mark Nudelman
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
|
@ -13,6 +13,17 @@
|
||||
======================================================================
|
||||
|
||||
|
||||
Major changes between "less" versions 409 and 415
|
||||
|
||||
* New --follow-name option makes F command follow the name of a file
|
||||
rather than the file descriptor if an open file is renamed.
|
||||
|
||||
* Make searching with -i/-I work correctly with non-ASCII text.
|
||||
|
||||
* Fix DJGPP build.
|
||||
|
||||
======================================================================
|
||||
|
||||
Major changes between "less" versions 406 and 409
|
||||
|
||||
* Support CSI escape sequences, like SGR escape sequences.
|
||||
@ -698,3 +709,4 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
Less, version 409
|
||||
Less, version 415
|
||||
|
||||
This is the distribution of less, version 409, released 12 Oct 2007.
|
||||
This is the distribution of less, version 415, released 15 Nov 2007.
|
||||
This program is part of the GNU project (http://www.gnu.org).
|
||||
|
||||
This program is free software. You may redistribute it and/or
|
||||
|
@ -21,6 +21,12 @@
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_STAT_INO
|
||||
#include <sys/stat.h>
|
||||
extern dev_t curr_dev;
|
||||
extern ino_t curr_ino;
|
||||
#endif
|
||||
|
||||
typedef POSITION BLOCKNUM;
|
||||
|
||||
public int ignore_eoi;
|
||||
@ -98,6 +104,8 @@ static int maxbufs = -1;
|
||||
extern int autobuf;
|
||||
extern int sigs;
|
||||
extern int secure;
|
||||
extern int screen_trashed;
|
||||
extern int follow_mode;
|
||||
extern constant char helpdata[];
|
||||
extern constant int size_helpdata;
|
||||
extern IFILE curr_ifile;
|
||||
@ -195,7 +203,7 @@ fch_get()
|
||||
*/
|
||||
if (!(ch_flags & CH_CANSEEK))
|
||||
return ('?');
|
||||
if (lseek(ch_file, (off_t)pos, 0) == BAD_LSEEK)
|
||||
if (lseek(ch_file, (off_t)pos, SEEK_SET) == BAD_LSEEK)
|
||||
{
|
||||
error("seek error", NULL_PARG);
|
||||
clear_eol();
|
||||
@ -276,6 +284,25 @@ fch_get()
|
||||
#endif
|
||||
#endif
|
||||
slept = TRUE;
|
||||
|
||||
#if HAVE_STAT_INO
|
||||
if (follow_mode == FOLLOW_NAME)
|
||||
{
|
||||
/* See whether the file's i-number has changed.
|
||||
* If so, force the file to be closed and
|
||||
* reopened. */
|
||||
struct stat st;
|
||||
int r = stat(get_filename(curr_ifile), &st);
|
||||
if (r == 0 && (st.st_ino != curr_ino ||
|
||||
st.st_dev != curr_dev))
|
||||
{
|
||||
/* screen_trashed=2 causes
|
||||
* make_display to reopen the file. */
|
||||
screen_trashed = 2;
|
||||
return (EOI);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if (sigs)
|
||||
return (EOI);
|
||||
@ -648,7 +675,7 @@ ch_flush()
|
||||
}
|
||||
#endif
|
||||
|
||||
if (lseek(ch_file, (off_t)0, 0) == BAD_LSEEK)
|
||||
if (lseek(ch_file, (off_t)0, SEEK_SET) == BAD_LSEEK)
|
||||
{
|
||||
/*
|
||||
* Warning only; even if the seek fails for some reason,
|
||||
@ -711,7 +738,7 @@ ch_delbufs()
|
||||
while (ch_bufhead != END_OF_CHAIN)
|
||||
{
|
||||
bp = ch_bufhead;
|
||||
bp->next->prev = bp->prev;;
|
||||
bp->next->prev = bp->prev;
|
||||
bp->prev->next = bp->next;
|
||||
free(bp);
|
||||
}
|
||||
@ -737,7 +764,7 @@ seekable(f)
|
||||
return (0);
|
||||
}
|
||||
#endif
|
||||
return (lseek(f, (off_t)1, 0) != BAD_LSEEK);
|
||||
return (lseek(f, (off_t)1, SEEK_SET) != BAD_LSEEK);
|
||||
}
|
||||
|
||||
/*
|
||||
|
230
contrib/less/configure
vendored
230
contrib/less/configure
vendored
@ -3611,6 +3611,73 @@ fi
|
||||
|
||||
|
||||
# Checks for general libraries.
|
||||
{ echo "$as_me:$LINENO: checking for tgoto in -ltinfo" >&5
|
||||
echo $ECHO_N "checking for tgoto in -ltinfo... $ECHO_C" >&6; }
|
||||
if test "${ac_cv_lib_tinfo_tgoto+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
ac_check_lib_save_LIBS=$LIBS
|
||||
LIBS="-ltinfo $LIBS"
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
|
||||
/* Override any GCC internal prototype to avoid an error.
|
||||
Use char because int might match the return type of a GCC
|
||||
builtin and then its argument prototype would still apply. */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
char tgoto ();
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return tgoto ();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
rm -f conftest.$ac_objext conftest$ac_exeext
|
||||
if { (ac_try="$ac_link"
|
||||
case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||
(eval "$ac_link") 2>conftest.er1
|
||||
ac_status=$?
|
||||
grep -v '^ *+' conftest.er1 >conftest.err
|
||||
rm -f conftest.er1
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } && {
|
||||
test -z "$ac_c_werror_flag" ||
|
||||
test ! -s conftest.err
|
||||
} && test -s conftest$ac_exeext &&
|
||||
$as_test_x conftest$ac_exeext; then
|
||||
ac_cv_lib_tinfo_tgoto=yes
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
ac_cv_lib_tinfo_tgoto=no
|
||||
fi
|
||||
|
||||
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
LIBS=$ac_check_lib_save_LIBS
|
||||
fi
|
||||
{ echo "$as_me:$LINENO: result: $ac_cv_lib_tinfo_tgoto" >&5
|
||||
echo "${ECHO_T}$ac_cv_lib_tinfo_tgoto" >&6; }
|
||||
if test $ac_cv_lib_tinfo_tgoto = yes; then
|
||||
have_tinfo=yes
|
||||
else
|
||||
have_tinfo=no
|
||||
fi
|
||||
|
||||
{ echo "$as_me:$LINENO: checking for initscr in -lxcurses" >&5
|
||||
echo $ECHO_N "checking for initscr in -lxcurses... $ECHO_C" >&6; }
|
||||
if test "${ac_cv_lib_xcurses_initscr+set}" = set; then
|
||||
@ -4246,6 +4313,61 @@ fi
|
||||
fi
|
||||
|
||||
if test $curses_broken = 0; then
|
||||
|
||||
# -- Try tinfo.
|
||||
if test "x$TERMLIBS" = x; then
|
||||
if test $have_tinfo = yes; then
|
||||
TERMLIBS="-ltinfo"
|
||||
SAVE_LIBS=$LIBS
|
||||
LIBS="$LIBS $TERMLIBS"
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
rm -f conftest.$ac_objext conftest$ac_exeext
|
||||
if { (ac_try="$ac_link"
|
||||
case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||
(eval "$ac_link") 2>conftest.er1
|
||||
ac_status=$?
|
||||
grep -v '^ *+' conftest.er1 >conftest.err
|
||||
rm -f conftest.er1
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } && {
|
||||
test -z "$ac_c_werror_flag" ||
|
||||
test ! -s conftest.err
|
||||
} && test -s conftest$ac_exeext &&
|
||||
$as_test_x conftest$ac_exeext; then
|
||||
termok=yes
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
termok=no
|
||||
fi
|
||||
|
||||
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
LIBS=$SAVE_LIBS
|
||||
if test $termok = no; then TERMLIBS=""; fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# -- Try xcurses.
|
||||
if test "x$TERMLIBS" = x; then
|
||||
if test $have_xcurses = yes; then
|
||||
@ -4895,7 +5017,8 @@ done
|
||||
|
||||
|
||||
|
||||
for ac_header in ctype.h errno.h fcntl.h limits.h stdio.h stdlib.h string.h termcap.h termio.h termios.h time.h unistd.h values.h sys/ioctl.h sys/stream.h
|
||||
|
||||
for ac_header in ctype.h errno.h fcntl.h limits.h stdio.h stdlib.h string.h termcap.h termio.h termios.h time.h unistd.h values.h sys/ioctl.h sys/stream.h wctype.h
|
||||
do
|
||||
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
|
||||
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
|
||||
@ -5443,6 +5566,10 @@ fi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -5655,6 +5782,55 @@ sed 's/^/| /' conftest.$ac_ext >&5
|
||||
echo "${ECHO_T}no" >&6; }
|
||||
fi
|
||||
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
{ echo "$as_me:$LINENO: checking for st_ino in struct stat" >&5
|
||||
echo $ECHO_N "checking for st_ino in struct stat... $ECHO_C" >&6; }
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
struct stat s; dev_t dev = s.st_dev; ino_t ino = s.st_ino;
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
rm -f conftest.$ac_objext
|
||||
if { (ac_try="$ac_compile"
|
||||
case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||
(eval "$ac_compile") 2>conftest.er1
|
||||
ac_status=$?
|
||||
grep -v '^ *+' conftest.er1 >conftest.err
|
||||
rm -f conftest.er1
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } && {
|
||||
test -z "$ac_c_werror_flag" ||
|
||||
test ! -s conftest.err
|
||||
} && test -s conftest.$ac_objext; then
|
||||
{ echo "$as_me:$LINENO: result: yes" >&5
|
||||
echo "${ECHO_T}yes" >&6; }; cat >>confdefs.h <<\_ACEOF
|
||||
#define HAVE_STAT_INO 1
|
||||
_ACEOF
|
||||
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
{ echo "$as_me:$LINENO: result: no" >&5
|
||||
echo "${ECHO_T}no" >&6; }
|
||||
fi
|
||||
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
|
||||
# Checks for library functions.
|
||||
@ -6515,6 +6691,7 @@ fi
|
||||
|
||||
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
|
||||
{ echo "$as_me:$LINENO: checking for ctype functions" >&5
|
||||
echo $ECHO_N "checking for ctype functions... $ECHO_C" >&6; }
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
@ -6566,6 +6743,57 @@ sed 's/^/| /' conftest.$ac_ext >&5
|
||||
echo "${ECHO_T}no" >&6; }
|
||||
fi
|
||||
|
||||
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
|
||||
{ echo "$as_me:$LINENO: checking for wctype functions" >&5
|
||||
echo $ECHO_N "checking for wctype functions... $ECHO_C" >&6; }
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
#include <wctype.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
iswlower(0); iswupper(0); towlower(0); towupper(0);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
rm -f conftest.$ac_objext conftest$ac_exeext
|
||||
if { (ac_try="$ac_link"
|
||||
case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||
(eval "$ac_link") 2>conftest.er1
|
||||
ac_status=$?
|
||||
grep -v '^ *+' conftest.er1 >conftest.err
|
||||
rm -f conftest.er1
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } && {
|
||||
test -z "$ac_c_werror_flag" ||
|
||||
test ! -s conftest.err
|
||||
} && test -s conftest$ac_exeext &&
|
||||
$as_test_x conftest$ac_exeext; then
|
||||
{ echo "$as_me:$LINENO: result: yes" >&5
|
||||
echo "${ECHO_T}yes" >&6; }; cat >>confdefs.h <<\_ACEOF
|
||||
#define HAVE_WCTYPE 1
|
||||
_ACEOF
|
||||
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
{ echo "$as_me:$LINENO: result: no" >&5
|
||||
echo "${ECHO_T}no" >&6; }
|
||||
fi
|
||||
|
||||
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
|
||||
|
@ -23,6 +23,7 @@ AC_PROG_INSTALL
|
||||
AC_SYS_LARGEFILE
|
||||
|
||||
# Checks for general libraries.
|
||||
AC_CHECK_LIB(tinfo, tgoto, [have_tinfo=yes], [have_tinfo=no])
|
||||
AC_CHECK_LIB(xcurses, initscr, [have_xcurses=yes], [have_xcurses=no])
|
||||
AC_CHECK_LIB(ncursesw, initscr, [have_ncursesw=yes], [have_ncursesw=no])
|
||||
AC_CHECK_LIB(ncurses, initscr, [have_ncurses=yes], [have_ncurses=no])
|
||||
@ -51,6 +52,20 @@ fi
|
||||
fi
|
||||
|
||||
if test $curses_broken = 0; then
|
||||
|
||||
# -- Try tinfo.
|
||||
if test "x$TERMLIBS" = x; then
|
||||
if test $have_tinfo = yes; then
|
||||
TERMLIBS="-ltinfo"
|
||||
SAVE_LIBS=$LIBS
|
||||
LIBS="$LIBS $TERMLIBS"
|
||||
AC_TRY_LINK(, [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
|
||||
[termok=yes], [termok=no])
|
||||
LIBS=$SAVE_LIBS
|
||||
if test $termok = no; then TERMLIBS=""; fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# -- Try xcurses.
|
||||
if test "x$TERMLIBS" = x; then
|
||||
if test $have_xcurses = yes; then
|
||||
@ -154,7 +169,7 @@ LIBS="$LIBS $TERMLIBS"
|
||||
|
||||
# Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS([ctype.h errno.h fcntl.h limits.h stdio.h stdlib.h string.h termcap.h termio.h termios.h time.h unistd.h values.h sys/ioctl.h sys/stream.h])
|
||||
AC_CHECK_HEADERS([ctype.h errno.h fcntl.h limits.h stdio.h stdlib.h string.h termcap.h termio.h termios.h time.h unistd.h values.h sys/ioctl.h sys/stream.h wctype.h])
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_HEADER_STAT
|
||||
@ -182,6 +197,8 @@ AH_TEMPLATE([HAVE_VOID],
|
||||
[Define HAVE_VOID if your compiler supports the "void" type.])
|
||||
AH_TEMPLATE([HAVE_CONST],
|
||||
[Define HAVE_CONST if your compiler supports the "const" modifier.])
|
||||
AH_TEMPLATE([HAVE_STAT_INO],
|
||||
[Define HAVE_STAT_INO if your struct stat has st_ino and st_dev.])
|
||||
AH_TEMPLATE([HAVE_TIME_T],
|
||||
[Define HAVE_TIME_T if your system supports the "time_t" type.])
|
||||
AH_TEMPLATE([HAVE_STRERROR],
|
||||
@ -204,6 +221,8 @@ AH_TEMPLATE([HAVE_TERMIOS_FUNCS],
|
||||
[Define HAVE_TERMIOS_FUNCS if you have tcgetattr/tcsetattr.])
|
||||
AH_TEMPLATE([HAVE_UPPER_LOWER],
|
||||
[Define HAVE_UPPER_LOWER if you have isupper, islower, toupper, tolower.])
|
||||
AH_TEMPLATE([HAVE_WCTYPE],
|
||||
[Define HAVE_WCTYPE if you have iswupper, iswlower, towupper, towlower.])
|
||||
AH_TEMPLATE([HAVE_SIGSET_T],
|
||||
[Define HAVE_SIGSET_T you have the sigset_t type.])
|
||||
AH_TEMPLATE([HAVE_SIGEMPTYSET],
|
||||
@ -224,6 +243,11 @@ AC_TRY_COMPILE(, [const int foo = 0;],
|
||||
AC_MSG_CHECKING(for time_t)
|
||||
AC_TRY_COMPILE([#include <time.h>], [time_t t = 0;],
|
||||
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_TIME_T)], [AC_MSG_RESULT(no)])
|
||||
AC_MSG_CHECKING(for st_ino in struct stat)
|
||||
AC_TRY_COMPILE([#include <sys/types.h>
|
||||
#include <sys/stat.h>],
|
||||
[struct stat s; dev_t dev = s.st_dev; ino_t ino = s.st_ino;],
|
||||
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_STAT_INO)], [AC_MSG_RESULT(no)])
|
||||
|
||||
# Checks for library functions.
|
||||
AC_TYPE_SIGNAL
|
||||
@ -307,6 +331,7 @@ AC_TRY_LINK([#include <locale.h>
|
||||
#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([
|
||||
#if HAVE_CTYPE_H
|
||||
@ -314,6 +339,10 @@ AC_TRY_LINK([
|
||||
#endif], [static int x; x = isupper(x); x = tolower(x); x = toupper(x);],
|
||||
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_UPPER_LOWER)], [AC_MSG_RESULT(no)])
|
||||
|
||||
AC_MSG_CHECKING(for wctype functions)
|
||||
AC_TRY_LINK([#include <wctype.h>], [iswlower(0); iswupper(0); towlower(0); towupper(0);],
|
||||
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_WCTYPE)], [AC_MSG_RESULT(no)])
|
||||
|
||||
# Checks for external variable ospeed in the termcap library.
|
||||
have_ospeed=no
|
||||
AC_MSG_CHECKING(termcap for ospeed)
|
||||
|
@ -682,7 +682,7 @@ lesskey(filename, sysvar)
|
||||
close(f);
|
||||
return (-1);
|
||||
}
|
||||
if (lseek(f, (off_t)0, 0) == BAD_LSEEK)
|
||||
if (lseek(f, (off_t)0, SEEK_SET) == BAD_LSEEK)
|
||||
{
|
||||
free(buf);
|
||||
close(f);
|
||||
|
@ -313,6 +313,9 @@
|
||||
/* Define if you have the <ctype.h> header file. */
|
||||
#define HAVE_CTYPE_H 1
|
||||
|
||||
/* Define if you have the <wctype.h> header file. */
|
||||
#define HAVE_WCTYPE_H 0
|
||||
|
||||
/* Define if you have the <errno.h> header file. */
|
||||
#define HAVE_ERRNO_H 1
|
||||
|
||||
|
@ -282,6 +282,9 @@
|
||||
/* Define to 1 if you have the `stat' function. */
|
||||
#undef HAVE_STAT
|
||||
|
||||
/* Define HAVE_STAT_INO if your struct stat has st_ino and st_dev. */
|
||||
#undef HAVE_STAT_INO
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
@ -351,6 +354,12 @@
|
||||
/* Define HAVE_VOID if your compiler supports the "void" type. */
|
||||
#undef HAVE_VOID
|
||||
|
||||
/* Define HAVE_WCTYPE if you have iswupper, iswlower, towupper, towlower. */
|
||||
#undef HAVE_WCTYPE
|
||||
|
||||
/* Define to 1 if you have the <wctype.h> header file. */
|
||||
#undef HAVE_WCTYPE_H
|
||||
|
||||
/* Define to 1 if you have the `_setjmp' function. */
|
||||
#undef HAVE__SETJMP
|
||||
|
||||
|
@ -279,6 +279,9 @@
|
||||
/* Define if you have the <ctype.h> header file. */
|
||||
#define HAVE_CTYPE_H 1
|
||||
|
||||
/* Define if you have the <wctype.h> header file. */
|
||||
#define HAVE_WCTYPE_H 0
|
||||
|
||||
/* Define if you have the <errno.h> header file. */
|
||||
#define HAVE_ERRNO_H 1
|
||||
|
||||
|
@ -287,6 +287,9 @@
|
||||
/* Define if you have the <ctype.h> header file. */
|
||||
#define HAVE_CTYPE_H 1
|
||||
|
||||
/* Define if you have the <wctype.h> header file. */
|
||||
#define HAVE_WCTYPE_H 0
|
||||
|
||||
/* Define if you have the <errno.h> header file. */
|
||||
#define HAVE_ERRNO_H 1
|
||||
|
||||
|
@ -277,6 +277,9 @@
|
||||
/* Define if you have the <ctype.h> header file. */
|
||||
#define HAVE_CTYPE_H 1
|
||||
|
||||
/* Define if you have the <wctype.h> header file. */
|
||||
#define HAVE_WCTYPE_H 1
|
||||
|
||||
/* Define if you have the <errno.h> header file. */
|
||||
#define HAVE_ERRNO_H 1
|
||||
|
||||
|
@ -10,6 +10,9 @@
|
||||
|
||||
|
||||
#include "less.h"
|
||||
#if HAVE_STAT
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
public int fd0 = 0;
|
||||
|
||||
@ -36,6 +39,11 @@ extern int force_logfile;
|
||||
extern char *namelogfile;
|
||||
#endif
|
||||
|
||||
#if HAVE_STAT_INO
|
||||
public dev_t curr_dev;
|
||||
public ino_t curr_ino;
|
||||
#endif
|
||||
|
||||
char *curr_altfilename = NULL;
|
||||
static void *curr_altpipe;
|
||||
|
||||
@ -178,6 +186,9 @@ close_file()
|
||||
curr_altfilename = NULL;
|
||||
}
|
||||
curr_ifile = NULL_IFILE;
|
||||
#if HAVE_STAT_INO
|
||||
curr_ino = curr_dev = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@ -360,7 +371,6 @@ edit_ifile(ifile)
|
||||
}
|
||||
}
|
||||
}
|
||||
free(qopen_filename);
|
||||
|
||||
/*
|
||||
* Get the new ifile.
|
||||
@ -384,11 +394,24 @@ edit_ifile(ifile)
|
||||
#if LOGFILE
|
||||
if (namelogfile != NULL && is_tty)
|
||||
use_logfile(namelogfile);
|
||||
#endif
|
||||
#if HAVE_STAT_INO
|
||||
/* Remember the i-number and device of the opened file. */
|
||||
{
|
||||
struct stat statbuf;
|
||||
int r = stat(qopen_filename, &statbuf);
|
||||
if (r == 0)
|
||||
{
|
||||
curr_ino = statbuf.st_ino;
|
||||
curr_dev = statbuf.st_dev;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (every_first_cmd != NULL)
|
||||
ungetsc(every_first_cmd);
|
||||
}
|
||||
|
||||
free(qopen_filename);
|
||||
no_display = !any_display;
|
||||
flush();
|
||||
any_display = TRUE;
|
||||
@ -657,6 +680,14 @@ reedit_ifile(save_ifile)
|
||||
quit(QUIT_ERROR);
|
||||
}
|
||||
|
||||
public void
|
||||
reopen_curr_ifile()
|
||||
{
|
||||
IFILE save_ifile = save_curr_ifile();
|
||||
close_file();
|
||||
reedit_ifile(save_ifile);
|
||||
}
|
||||
|
||||
/*
|
||||
* Edit standard input.
|
||||
*/
|
||||
@ -747,7 +778,7 @@ use_logfile(filename)
|
||||
* Append: open the file and seek to the end.
|
||||
*/
|
||||
logfile = open(filename, OPEN_APPEND);
|
||||
if (lseek(logfile, (off_t)0, 2) == BAD_LSEEK)
|
||||
if (lseek(logfile, (off_t)0, SEEK_END) == BAD_LSEEK)
|
||||
{
|
||||
close(logfile);
|
||||
logfile = -1;
|
||||
|
@ -476,7 +476,7 @@ bin_file(f)
|
||||
|
||||
if (!seekable(f))
|
||||
return (0);
|
||||
if (lseek(f, (off_t)0, 0) == BAD_LSEEK)
|
||||
if (lseek(f, (off_t)0, SEEK_SET) == BAD_LSEEK)
|
||||
return (0);
|
||||
n = read(f, data, sizeof(data));
|
||||
for (i = 0; i < n; i++)
|
||||
@ -505,7 +505,7 @@ seek_filesize(f)
|
||||
{
|
||||
off_t spos;
|
||||
|
||||
spos = lseek(f, (off_t)0, 2);
|
||||
spos = lseek(f, (off_t)0, SEEK_END);
|
||||
if (spos == BAD_LSEEK)
|
||||
return (NULL_POSITION);
|
||||
return ((POSITION) spos);
|
||||
|
@ -104,6 +104,7 @@
|
||||
public IFILE save_curr_ifile ();
|
||||
public void unsave_ifile ();
|
||||
public void reedit_ifile ();
|
||||
public void reopen_curr_ifile ();
|
||||
public int edit_stdin ();
|
||||
public void cat_file ();
|
||||
public void use_logfile ();
|
||||
|
@ -750,11 +750,6 @@ LESS(1) LESS(1)
|
||||
deinitialization string does something unnecessary, like clear-
|
||||
ing the screen.
|
||||
|
||||
--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.
|
||||
|
||||
-y[4mn[24m or --max-forw-scroll=[4mn[0m
|
||||
Specifies a maximum number of lines to scroll forward. If it is
|
||||
necessary to scroll forward more than [4mn[24m lines, the screen is
|
||||
@ -797,6 +792,21 @@ LESS(1) LESS(1)
|
||||
fied is zero, it sets the default number of positions to one
|
||||
half of the screen width.
|
||||
|
||||
--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.
|
||||
|
||||
--follow-name
|
||||
Normally, if the input file is renamed while an F command is
|
||||
executing, [4mless[24m will continue to display the contents of the
|
||||
original file despite its name change. If --follow-name is
|
||||
specified, during an F command [4mless[24m will periodically attempt to
|
||||
reopen the file by name. If the reopen succeeds and the file is
|
||||
a different file from the original (which means that a new file
|
||||
has been created with the same name as the original (now
|
||||
renamed) file), [4mless[24m will display the contents of that new file.
|
||||
|
||||
-- A command line argument of "--" marks the end of option argu-
|
||||
ments. Any arguments following this are interpreted as file-
|
||||
names. This can be useful when viewing a file whose name begins
|
||||
@ -1149,10 +1159,10 @@ LESS(1) LESS(1)
|
||||
is followed by a single character (shown as [4mX[24m above) which spec-
|
||||
ifies the line whose byte offset is to be used. If the charac-
|
||||
ter is a "t", the byte offset of the top line in the display is
|
||||
used, an "m" means use the middle line, a "b" means use the bot-
|
||||
tom line, a "B" means use the line just after the bottom line,
|
||||
and a "j" means use the "target" line, as specified by the -j
|
||||
option.
|
||||
used, an "m" means use the middle line, a "b" means use the
|
||||
bottom line, a "B" means use the line just after the bottom
|
||||
line, and a "j" means use the "target" line, as specified by the
|
||||
-j option.
|
||||
|
||||
%B Replaced by the size of the current input file.
|
||||
|
||||
@ -1499,10 +1509,10 @@ LESS(1) LESS(1)
|
||||
expressions turned off via ^R, and also does not occur when [4mless[24m is
|
||||
compiled to use the PCRE regular expression library.
|
||||
|
||||
In certain cases, when search highlighting is enabled and a search pat-
|
||||
tern begins with a ^, more text than the matching string may be high-
|
||||
lighted. (This problem does not occur when less is compiled to use the
|
||||
POSIX regular expression package.)
|
||||
In certain cases, when search highlighting is enabled and a search
|
||||
pattern begins with a ^, more text than the matching string may be
|
||||
highlighted. (This problem does not occur when less is compiled to use
|
||||
the POSIX regular expression package.)
|
||||
|
||||
On some systems, [4msetlocale[24m claims that ASCII characters 0 thru 31 are
|
||||
control characters rather than binary characters. This causes [4mless[24m to
|
||||
@ -1544,4 +1554,4 @@ LESS(1) LESS(1)
|
||||
|
||||
|
||||
|
||||
Version 409: 12 Oct 2007 LESS(1)
|
||||
Version 415: 15 Nov 2007 LESS(1)
|
||||
|
@ -1,4 +1,4 @@
|
||||
.TH LESS 1 "Version 409: 12 Oct 2007"
|
||||
.TH LESS 1 "Version 415: 15 Nov 2007"
|
||||
.SH NAME
|
||||
less \- opposite of more
|
||||
.SH SYNOPSIS
|
||||
@ -799,11 +799,6 @@ Disables sending the termcap initialization and deinitialization strings
|
||||
to the terminal.
|
||||
This is sometimes desirable if the deinitialization string does
|
||||
something unnecessary, like clearing the screen.
|
||||
.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 "\-y\fIn\fP or \-\-max-forw-scroll=\fIn\fP"
|
||||
Specifies a maximum number of lines to scroll forward.
|
||||
If it is necessary to scroll forward more than \fIn\fP lines,
|
||||
@ -847,6 +842,24 @@ Specifies the default number of positions to scroll horizontally
|
||||
in the RIGHTARROW and LEFTARROW commands.
|
||||
If the number specified is zero, it sets the default number of
|
||||
positions to one half 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
|
||||
will continue to display the contents of the original file despite
|
||||
its name change.
|
||||
If \-\-follow-name is specified, during an F command
|
||||
.I less
|
||||
will periodically attempt to reopen the file by name.
|
||||
If the reopen succeeds and the file is a different file from the original
|
||||
(which means that a new file has been created
|
||||
with the same name as the original (now renamed) file),
|
||||
.I less
|
||||
will display the contents of that new file.
|
||||
.IP \-\-
|
||||
A command line argument of "\-\-" marks the end of option arguments.
|
||||
Any arguments following this are interpreted as filenames.
|
||||
|
@ -46,4 +46,4 @@ LESSECHO(1) LESSECHO(1)
|
||||
|
||||
|
||||
|
||||
Version 409: 12 Oct 2007 LESSECHO(1)
|
||||
Version 415: 15 Nov 2007 LESSECHO(1)
|
||||
|
@ -1,4 +1,4 @@
|
||||
.TH LESSECHO 1 "Version 409: 12 Oct 2007"
|
||||
.TH LESSECHO 1 "Version 415: 15 Nov 2007"
|
||||
.SH NAME
|
||||
lessecho \- expand metacharacters
|
||||
.SH SYNOPSIS
|
||||
|
@ -357,4 +357,4 @@ LESSKEY(1) LESSKEY(1)
|
||||
|
||||
|
||||
|
||||
Version 409: 12 Oct 2007 LESSKEY(1)
|
||||
Version 415: 15 Nov 2007 LESSKEY(1)
|
||||
|
@ -1,4 +1,4 @@
|
||||
.TH LESSKEY 1 "Version 409: 12 Oct 2007"
|
||||
.TH LESSKEY 1 "Version 415: 15 Nov 2007"
|
||||
.SH NAME
|
||||
lesskey \- specify key bindings for less
|
||||
.SH SYNOPSIS
|
||||
|
@ -442,7 +442,7 @@ opt__V(type, s)
|
||||
any_display = 1;
|
||||
putstr("less ");
|
||||
putstr(version);
|
||||
putstr("\nCopyright (C) 1984-2005 Mark Nudelman\n\n");
|
||||
putstr("\nCopyright (C) 1984-2007 Mark Nudelman\n\n");
|
||||
putstr("less comes with NO WARRANTY, to the extent permitted by law.\n");
|
||||
putstr("For information about the terms of redistribution,\n");
|
||||
putstr("see the file named README in the less distribution.\n");
|
||||
|
@ -50,7 +50,8 @@ public int shift_count; /* Number of positions to shift horizontally */
|
||||
public int status_col; /* Display a status column */
|
||||
public int use_lessopen; /* Use the LESSOPEN filter */
|
||||
public int quit_on_intr; /* Quit on interrupt */
|
||||
public int oldbot; /* Old bottom of screen behavior */
|
||||
public int follow_mode; /* F cmd Follows file desc or file name? */
|
||||
public int oldbot; /* Old bottom of screen behavior {{REMOVE}} */
|
||||
#if HILITE_SEARCH
|
||||
public int hilite_search; /* Highlight matched search patterns? */
|
||||
#endif
|
||||
@ -113,6 +114,7 @@ static struct optname query_optname = { "help", NULL };
|
||||
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 };
|
||||
|
||||
|
||||
/*
|
||||
@ -440,6 +442,14 @@ static struct loption option[] =
|
||||
NULL
|
||||
}
|
||||
},
|
||||
{ '.', &follow_optname,
|
||||
BOOL, FOLLOW_DESC, &follow_mode, NULL,
|
||||
{
|
||||
"F command Follows file descriptor",
|
||||
"F command Follows file name",
|
||||
NULL
|
||||
}
|
||||
},
|
||||
{ '\0', NULL, NOVAR, 0, NULL, NULL, { NULL, NULL, NULL } }
|
||||
};
|
||||
|
||||
|
@ -662,7 +662,7 @@ prevgtag()
|
||||
/*
|
||||
* Position the current file at at what is hopefully the tag that was chosen
|
||||
* using either findtag() or one of nextgtag() and prevgtag(). Returns -1
|
||||
* if it was unable to position at the tag, 0 if succesful.
|
||||
* if it was unable to position at the tag, 0 if successful.
|
||||
*/
|
||||
static POSITION
|
||||
gtagsearch()
|
||||
|
@ -696,6 +696,11 @@ 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.
|
||||
v409 10/12/07 Fix crash when viewing text with invalid UTF-8 sequences.
|
||||
v411 11/6/07 Fix case-insensitive searching with non-ASCII text.
|
||||
v412 11/6/07 Use symbolic SEEK constants.
|
||||
v413 11/6/07 Fix search highlight bug with non-ASCII text.
|
||||
v414 11/6/07 Fix display bug with no-wrap terminals.
|
||||
v415 11/14/07 Add --follow-name option.
|
||||
*/
|
||||
|
||||
char version[] = "409";
|
||||
char version[] = "415";
|
||||
|
Loading…
Reference in New Issue
Block a user