Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Apr 2017 06:30:21 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org
Subject:   svn commit: r317581 - vendor/less/dist
Message-ID:  <201704290630.v3T6ULRU092449@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Sat Apr 29 06:30:21 2017
New Revision: 317581
URL: https://svnweb.freebsd.org/changeset/base/317581

Log:
  Vendor import of less v491.

Added:
  vendor/less/dist/mkfuncs.pl
     - copied, changed from r317580, vendor/less/dist/mkfuncs.awk
Deleted:
  vendor/less/dist/mkfuncs.awk
Modified:
  vendor/less/dist/Makefile.aut
  vendor/less/dist/Makefile.dsg
  vendor/less/dist/NEWS
  vendor/less/dist/README
  vendor/less/dist/brac.c
  vendor/less/dist/ch.c
  vendor/less/dist/charset.c
  vendor/less/dist/charset.h
  vendor/less/dist/cmd.h
  vendor/less/dist/cmdbuf.c
  vendor/less/dist/command.c
  vendor/less/dist/configure
  vendor/less/dist/configure.ac
  vendor/less/dist/cvt.c
  vendor/less/dist/decode.c
  vendor/less/dist/defines.ds
  vendor/less/dist/defines.h.in
  vendor/less/dist/defines.o2
  vendor/less/dist/defines.o9
  vendor/less/dist/defines.wn
  vendor/less/dist/edit.c
  vendor/less/dist/filename.c
  vendor/less/dist/forwback.c
  vendor/less/dist/funcs.h
  vendor/less/dist/ifile.c
  vendor/less/dist/input.c
  vendor/less/dist/jump.c
  vendor/less/dist/less.h
  vendor/less/dist/less.man
  vendor/less/dist/less.nro
  vendor/less/dist/lessecho.c
  vendor/less/dist/lessecho.man
  vendor/less/dist/lessecho.nro
  vendor/less/dist/lesskey.c
  vendor/less/dist/lesskey.h
  vendor/less/dist/lesskey.man
  vendor/less/dist/lesskey.nro
  vendor/less/dist/lglob.h
  vendor/less/dist/line.c
  vendor/less/dist/linenum.c
  vendor/less/dist/lsystem.c
  vendor/less/dist/main.c
  vendor/less/dist/mark.c
  vendor/less/dist/mkhelp.c
  vendor/less/dist/optfunc.c
  vendor/less/dist/option.c
  vendor/less/dist/option.h
  vendor/less/dist/opttbl.c
  vendor/less/dist/os.c
  vendor/less/dist/output.c
  vendor/less/dist/pattern.c
  vendor/less/dist/pattern.h
  vendor/less/dist/pckeys.h
  vendor/less/dist/position.c
  vendor/less/dist/position.h
  vendor/less/dist/prompt.c
  vendor/less/dist/screen.c
  vendor/less/dist/scrsize.c
  vendor/less/dist/search.c
  vendor/less/dist/signal.c
  vendor/less/dist/tags.c
  vendor/less/dist/ttyin.c
  vendor/less/dist/version.c

Modified: vendor/less/dist/Makefile.aut
==============================================================================
--- vendor/less/dist/Makefile.aut	Sat Apr 29 02:03:20 2017	(r317580)
+++ vendor/less/dist/Makefile.aut	Sat Apr 29 06:30:21 2017	(r317581)
@@ -32,7 +32,7 @@ DISTFILES = \
 	install.sh defines.h.in mkinstalldirs \
 	less.nro less.man lesskey.nro lesskey.man lessecho.nro lessecho.man \
 	less.hlp \
-	mkfuncs.awk mkhelp.c \
+	mkfuncs.pl mkhelp.c \
 	mkutable $(UNICODE_FILES) \
 	${DISTFILES_W}
 
@@ -61,7 +61,7 @@ ${srcdir}/configure: ${srcdir}/configure
 
 funcs.h: ${SRC:%=${srcdir}/%}
 	-mv -f ${srcdir}/funcs.h ${srcdir}/funcs.h.old
-	awk -f ${srcdir}/mkfuncs.awk ${SRC:%=${srcdir}/%} >${srcdir}/funcs.h
+	perl ${srcdir}/mkfuncs.pl ${SRC:%=${srcdir}/%} >${srcdir}/funcs.h
 	if cmp -s funcs.h funcs.h.old; then mv -f funcs.h.old funcs.h; fi
 
 lint:

Modified: vendor/less/dist/Makefile.dsg
==============================================================================
--- vendor/less/dist/Makefile.dsg	Sat Apr 29 02:03:20 2017	(r317580)
+++ vendor/less/dist/Makefile.dsg	Sat Apr 29 06:30:21 2017	(r317581)
@@ -73,10 +73,6 @@ installcheck:
 TAGS:
 	etags *.c *.h
 
-newfuncs:
-	command.com /c if exist funcs.h del funcs.h
-	${AWK} -f mkfuncs.awk ${OBJ:.${O}=.c} > funcs.h
-
 clean:
 	command.com /c for %f in (*.${O} less lesskey lessecho *.exe) do if exist %f del %f
 

Modified: vendor/less/dist/NEWS
==============================================================================
--- vendor/less/dist/NEWS	Sat Apr 29 02:03:20 2017	(r317580)
+++ vendor/less/dist/NEWS	Sat Apr 29 06:30:21 2017	(r317581)
@@ -11,6 +11,20 @@
 
 ======================================================================
 
+	Major changes between "less" versions 487 and 491
+
+* Don't output terminal init sequence if using -F and file fits on one screen.
+
+* Use ANSI prototypes in funcs.h declarations.
+
+* Fix some const mismatches.
+
+* Remove "register" in variable declarations.
+
+* Fix some memory leaks.
+
+======================================================================
+
 	Major changes between "less" versions 481 and 487
 
 * New commands ESC-{ and ESC-} to shift to start/end of displayed lines.

Modified: vendor/less/dist/README
==============================================================================
--- vendor/less/dist/README	Sat Apr 29 02:03:20 2017	(r317580)
+++ vendor/less/dist/README	Sat Apr 29 06:30:21 2017	(r317581)
@@ -1,7 +1,7 @@
 
-                            Less, version 487
+                            Less, version 491
 
-    This is the distribution of less, version 487, released 25 Oct 2016.
+    This is the distribution of less, version 491, released 07 Apr 2017.
     This program is part of the GNU project (http://www.gnu.org).
 
     This program is free software.  You may redistribute it and/or

Modified: vendor/less/dist/brac.c
==============================================================================
--- vendor/less/dist/brac.c	Sat Apr 29 02:03:20 2017	(r317580)
+++ vendor/less/dist/brac.c	Sat Apr 29 06:30:21 2017	(r317581)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1984-2016  Mark Nudelman
+ * Copyright (C) 1984-2017  Mark Nudelman
  *
  * You may distribute under the terms of either the GNU General Public
  * License or the Less License, as specified in the README file.
@@ -25,13 +25,13 @@
  */
 	public void
 match_brac(obrac, cbrac, forwdir, n)
-	register int obrac;
-	register int cbrac;
+	int obrac;
+	int cbrac;
 	int forwdir;
 	int n;
 {
-	register int c;
-	register int nest;
+	int c;
+	int nest;
 	POSITION pos;
 	int (*chget)();
 

Modified: vendor/less/dist/ch.c
==============================================================================
--- vendor/less/dist/ch.c	Sat Apr 29 02:03:20 2017	(r317580)
+++ vendor/less/dist/ch.c	Sat Apr 29 06:30:21 2017	(r317581)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1984-2016  Mark Nudelman
+ * Copyright (C) 1984-2017  Mark Nudelman
  *
  * You may distribute under the terms of either the GNU General Public
  * License or the Less License, as specified in the README file.
@@ -146,11 +146,11 @@ static int ch_addbuf();
 	int
 ch_get()
 {
-	register struct buf *bp;
-	register struct bufnode *bn;
-	register int n;
-	register int slept;
-	register int h;
+	struct buf *bp;
+	struct bufnode *bn;
+	int n;
+	int slept;
+	int h;
 	POSITION pos;
 	POSITION len;
 
@@ -419,8 +419,8 @@ end_logfile()
 	public void
 sync_logfile()
 {
-	register struct buf *bp;
-	register struct bufnode *bn;
+	struct buf *bp;
+	struct bufnode *bn;
 	int warned = FALSE;
 	BLOCKNUM block;
 	BLOCKNUM nblocks;
@@ -457,9 +457,9 @@ sync_logfile()
 buffered(block)
 	BLOCKNUM block;
 {
-	register struct buf *bp;
-	register struct bufnode *bn;
-	register int h;
+	struct buf *bp;
+	struct bufnode *bn;
+	int h;
 
 	h = BUFHASH(block);
 	FOR_BUFS_IN_CHAIN(h, bn)
@@ -477,7 +477,7 @@ buffered(block)
  */
 	public int
 ch_seek(pos)
-	register POSITION pos;
+	POSITION pos;
 {
 	BLOCKNUM new_block;
 	POSITION len;
@@ -544,8 +544,8 @@ ch_end_seek()
 	public int
 ch_end_buffer_seek()
 {
-	register struct buf *bp;
-	register struct bufnode *bn;
+	struct buf *bp;
+	struct bufnode *bn;
 	POSITION buf_pos;
 	POSITION end_pos;
 
@@ -572,8 +572,8 @@ ch_end_buffer_seek()
 	public int
 ch_beg_seek()
 {
-	register struct bufnode *bn;
-	register struct bufnode *firstbn;
+	struct bufnode *bn;
+	struct bufnode *firstbn;
 
 	/*
 	 * Try a plain ch_seek first.
@@ -632,7 +632,7 @@ ch_tell()
 	public int
 ch_forw_get()
 {
-	register int c;
+	int c;
 
 	if (thisfile == NULL)
 		return (EOI);
@@ -695,7 +695,7 @@ ch_setbufspace(bufspace)
 	public void
 ch_flush()
 {
-	register struct bufnode *bn;
+	struct bufnode *bn;
 
 	if (thisfile == NULL)
 		return;
@@ -762,8 +762,8 @@ ch_flush()
 	static int
 ch_addbuf()
 {
-	register struct buf *bp;
-	register struct bufnode *bn;
+	struct buf *bp;
+	struct bufnode *bn;
 
 	/*
 	 * Allocate and initialize a new buffer and link it 
@@ -787,7 +787,7 @@ ch_addbuf()
 	static void
 init_hashtbl()
 {
-	register int h;
+	int h;
 
 	for (h = 0;  h < BUFHASH_SIZE;  h++)
 	{
@@ -802,7 +802,7 @@ init_hashtbl()
 	static void
 ch_delbufs()
 {
-	register struct bufnode *bn;
+	struct bufnode *bn;
 
 	while (ch_bufhead != END_OF_CHAIN)
 	{

Modified: vendor/less/dist/charset.c
==============================================================================
--- vendor/less/dist/charset.c	Sat Apr 29 02:03:20 2017	(r317580)
+++ vendor/less/dist/charset.c	Sat Apr 29 06:30:21 2017	(r317581)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1984-2016  Mark Nudelman
+ * Copyright (C) 1984-2017  Mark Nudelman
  *
  * You may distribute under the terms of either the GNU General Public
  * License or the Less License, as specified in the README file.
@@ -135,9 +135,9 @@ public int binattr = AT_STANDOUT;
 ichardef(s)
 	char *s;
 {
-	register char *cp;
-	register int n;
-	register char v;
+	char *cp;
+	int n;
+	char v;
 
 	n = 0;
 	v = 0;
@@ -190,11 +190,11 @@ ichardef(s)
  */
 	static int
 icharset(name, no_error)
-	register char *name;
+	char *name;
 	int no_error;
 {
-	register struct charset *p;
-	register struct cs_alias *a;
+	struct charset *p;
+	struct cs_alias *a;
 
 	if (name == NULL || *name == '\0')
 		return (0);
@@ -234,7 +234,7 @@ icharset(name, no_error)
 	static void
 ilocale()
 {
-	register int c;
+	int c;
 
 	for (c = 0;  c < (int) sizeof(chardef);  c++)
 	{
@@ -486,7 +486,7 @@ prutfchar(ch)
  */
 	public int
 utf_len(ch)
-	char ch;
+	unsigned char ch;
 {
 	if ((ch & 0x80) == 0)
 		return 1;
@@ -508,17 +508,18 @@ utf_len(ch)
  * Does the parameter point to the lead byte of a well-formed UTF-8 character?
  */
 	public int
-is_utf8_well_formed(s, slen)
-	unsigned char *s;
+is_utf8_well_formed(ss, slen)
+	char *ss;
 	int slen;
 {
 	int i;
 	int len;
+	unsigned char *s = (unsigned char *) ss;
 
 	if (IS_UTF8_INVALID(s[0]))
 		return (0);
 
-	len = utf_len((char) s[0]);
+	len = utf_len(s[0]);
 	if (len > slen)
 		return (0);
 	if (len == 1)
@@ -546,7 +547,7 @@ is_utf8_well_formed(s, slen)
  */
 	public int
 utf_bin_count(data, len)
-	unsigned char *data;
+	char *data;
 	int len;
 {
 	int bin_count = 0;
@@ -554,7 +555,7 @@ utf_bin_count(data, len)
 	{
 		if (is_utf8_well_formed(data, len))
 		{
-			int clen = utf_len(*data);
+			int clen = utf_len(*data & 0377);
 			data += clen;
 			len -= clen;
 		} else
@@ -564,7 +565,7 @@ utf_bin_count(data, len)
 			do {
 				++data;
 				--len;
-			} while (len > 0 && !IS_UTF8_LEAD(*data));
+			} while (len > 0 && !IS_UTF8_LEAD(*data & 0377));
 		}
 	}
 	return (bin_count);
@@ -575,7 +576,7 @@ utf_bin_count(data, len)
  */
 	public LWCHAR
 get_wchar(p)
-	char *p;
+	constant char *p;
 {
 	switch (utf_len(p[0]))
 	{
@@ -679,7 +680,7 @@ put_wchar(pp, ch)
 step_char(pp, dir, limit)
 	char **pp;
 	signed int dir;
-	char *limit;
+	constant char *limit;
 {
 	LWCHAR ch;
 	int len;
@@ -698,7 +699,7 @@ step_char(pp, dir, limit)
 		if (p + len > limit)
 		{
 			ch = 0;
-			p = limit;
+			p = (char *) limit;
 		} else
 		{
 			ch = get_wchar(p);

Modified: vendor/less/dist/charset.h
==============================================================================
--- vendor/less/dist/charset.h	Sat Apr 29 02:03:20 2017	(r317580)
+++ vendor/less/dist/charset.h	Sat Apr 29 06:30:21 2017	(r317581)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1984-2016  Mark Nudelman
+ * Copyright (C) 1984-2017  Mark Nudelman
  *
  * You may distribute under the terms of either the GNU General Public
  * License or the Less License, as specified in the README file.

Modified: vendor/less/dist/cmd.h
==============================================================================
--- vendor/less/dist/cmd.h	Sat Apr 29 02:03:20 2017	(r317580)
+++ vendor/less/dist/cmd.h	Sat Apr 29 06:30:21 2017	(r317581)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1984-2016  Mark Nudelman
+ * Copyright (C) 1984-2017  Mark Nudelman
  *
  * You may distribute under the terms of either the GNU General Public
  * License or the Less License, as specified in the README file.

Modified: vendor/less/dist/cmdbuf.c
==============================================================================
--- vendor/less/dist/cmdbuf.c	Sat Apr 29 02:03:20 2017	(r317580)
+++ vendor/less/dist/cmdbuf.c	Sat Apr 29 06:30:21 2017	(r317581)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1984-2016  Mark Nudelman
+ * Copyright (C) 1984-2017  Mark Nudelman
  *
  * You may distribute under the terms of either the GNU General Public
  * License or the Less License, as specified in the README file.
@@ -76,25 +76,25 @@ struct mlist
  */
 struct mlist mlist_search =  
 	{ &mlist_search,  &mlist_search,  &mlist_search,  NULL, 0 };
-public void * constant ml_search = (void *) &mlist_search;
+public void *ml_search = (void *) &mlist_search;
 
 struct mlist mlist_examine = 
 	{ &mlist_examine, &mlist_examine, &mlist_examine, NULL, 0 };
-public void * constant ml_examine = (void *) &mlist_examine;
+public void *ml_examine = (void *) &mlist_examine;
 
 #if SHELL_ESCAPE || PIPEC
 struct mlist mlist_shell =   
 	{ &mlist_shell,   &mlist_shell,   &mlist_shell,   NULL, 0 };
-public void * constant ml_shell = (void *) &mlist_shell;
+public void *ml_shell = (void *) &mlist_shell;
 #endif
 
 #else /* CMD_HISTORY */
 
 /* If CMD_HISTORY is off, these are just flags. */
-public void * constant ml_search = (void *)1;
-public void * constant ml_examine = (void *)2;
+public void *ml_search = (void *)1;
+public void *ml_examine = (void *)2;
 #if SHELL_ESCAPE || PIPEC
-public void * constant ml_shell = (void *)3;
+public void *ml_shell = (void *)3;
 #endif
 
 #endif /* CMD_HISTORY */
@@ -141,14 +141,14 @@ clear_cmd()
  */
 	public void
 cmd_putstr(s)
-	char *s;
+	constant char *s;
 {
 	LWCHAR prev_ch = 0;
 	LWCHAR ch;
-	char *endline = s + strlen(s);
+	constant char *endline = s + strlen(s);
 	while (*s != '\0')
 	{
-		char *ns = s;
+		char *ns = (char *) s;
 		int width;
 		ch = step_char(&ns, +1, endline);
 		while (s < ns)
@@ -262,7 +262,7 @@ cmd_step_left(pp, pwidth, bswidth)
  */
 	static void
 cmd_repaint(old_cp)
-	char *old_cp;
+	constant char *old_cp;
 {
 	/*
 	 * Repaint the line from the current position.
@@ -323,8 +323,8 @@ cmd_home()
 	static void
 cmd_lshift()
 {
-	char *s;
-	char *save_cp;
+	constant char *s;
+	constant char *save_cp;
 	int cols;
 
 	/*
@@ -342,7 +342,7 @@ cmd_lshift()
 	while (*s != '\0')
 	{
 		int width;
-		char *ns = s;
+		constant char *ns = s;
 		cmd_step_right(&ns, &width, NULL);
 		if (width > 0)
 			break;
@@ -361,8 +361,8 @@ cmd_lshift()
 	static void
 cmd_rshift()
 {
-	char *s;
-	char *save_cp;
+	constant char *s;
+	constant char *save_cp;
 	int cols;
 
 	/*
@@ -493,7 +493,7 @@ cmd_ichar(cs, clen)
 	static int
 cmd_erase()
 {
-	register char *s;
+	char *s;
 	int clen;
 
 	if (cp == cmdbuf)
@@ -661,7 +661,7 @@ set_mlist(mlist, cmdflags)
 cmd_updown(action)
 	int action;
 {
-	char *s;
+	constant char *s;
 	struct mlist *ml;
 	
 	if (curr_mlist == NULL)
@@ -723,7 +723,7 @@ cmd_updown(action)
 	public void
 cmd_addhist(mlist, cmd, modified)
 	struct mlist *mlist;
-	char *cmd;
+	constant char *cmd;
 	int modified;
 {
 #if CMD_HISTORY
@@ -940,7 +940,7 @@ delimit_word()
 	char *p;
 	int delim_quoted = 0;
 	int meta_quoted = 0;
-	char *esc = get_meta_escape();
+	constant char *esc = get_meta_escape();
 	int esclen = (int) strlen(esc);
 #endif
 	

Modified: vendor/less/dist/command.c
==============================================================================
--- vendor/less/dist/command.c	Sat Apr 29 02:03:20 2017	(r317580)
+++ vendor/less/dist/command.c	Sat Apr 29 06:30:21 2017	(r317581)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1984-2016  Mark Nudelman
+ * Copyright (C) 1984-2017  Mark Nudelman
  *
  * You may distribute under the terms of either the GNU General Public
  * License or the Less License, as specified in the README file.
@@ -42,10 +42,10 @@ extern char *curr_altfilename;
 extern char version[];
 extern struct scrpos initial_scrpos;
 extern IFILE curr_ifile;
-extern void constant *ml_search;
-extern void constant *ml_examine;
+extern void *ml_search;
+extern void *ml_examine;
 #if SHELL_ESCAPE || PIPEC
-extern void constant *ml_shell;
+extern void *ml_shell;
 #endif
 #if EDITOR
 extern char *editor;
@@ -106,7 +106,7 @@ cmd_exec()
 start_mca(action, prompt, mlist, cmdflags)
 	int action;
 	constant char *prompt;
-	constant void *mlist;
+	void *mlist;
 	int cmdflags;
 {
 	mca = action;
@@ -206,7 +206,7 @@ mca_opt_toggle()
 	static void
 exec_mca()
 {
-	register char *cbuf;
+	char *cbuf;
 
 	cmd_exec();
 	cbuf = get_cmdbuf();
@@ -685,7 +685,7 @@ make_display()
 	static void
 prompt()
 {
-	register constant char *p;
+	constant char *p;
 
 	if (ungot != NULL && !ungot->ug_end_command)
 	{
@@ -849,7 +849,7 @@ ungetcc(c)
 ungetsc(s)
 	char *s;
 {
-	register char *p;
+	char *p;
 
 	for (p = s + strlen(s) - 1;  p >= s;  p--)
 		ungetcc(*p);
@@ -866,7 +866,7 @@ multi_search(pattern, n, silent)
 	int n;
 	int silent;
 {
-	register int nomore;
+	int nomore;
 	IFILE save_ifile;
 	int changed_file;
 
@@ -1001,9 +1001,9 @@ forw_loop(until_hilite)
 	public void
 commands()
 {
-	register int c;
-	register int action;
-	register char *cbuf;
+	int c;
+	int action;
+	char *cbuf;
 	int newaction;
 	int save_search_type;
 	char *extra;

Modified: vendor/less/dist/configure
==============================================================================
--- vendor/less/dist/configure	Sat Apr 29 02:03:20 2017	(r317580)
+++ vendor/less/dist/configure	Sat Apr 29 06:30:21 2017	(r317581)
@@ -4713,6 +4713,30 @@ $as_echo "no" >&6; }
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
+# Checks for ANSI function prototypes.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI function prototypes" >&5
+$as_echo_n "checking for ANSI function prototypes... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+int f(int a) { return a; }
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }; $as_echo "#define HAVE_ANSI_PROTOS 1" >>confdefs.h
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 # Checks for library functions.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5
 $as_echo_n "checking return type of signal handlers... " >&6; }

Modified: vendor/less/dist/configure.ac
==============================================================================
--- vendor/less/dist/configure.ac	Sat Apr 29 02:03:20 2017	(r317580)
+++ vendor/less/dist/configure.ac	Sat Apr 29 06:30:21 2017	(r317581)
@@ -251,6 +251,11 @@ AC_TRY_COMPILE([#include <sys/types.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 ANSI function prototypes.
+AC_MSG_CHECKING(for ANSI function prototypes)
+AC_TRY_COMPILE([], [int f(int a) { return a; }],
+  [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ANSI_PROTOS)], [AC_MSG_RESULT(no)])
+
 # Checks for library functions.
 AC_TYPE_SIGNAL
 AC_CHECK_FUNCS([fsync popen _setjmp sigprocmask sigsetmask snprintf stat system fchmod])
@@ -621,6 +626,11 @@ AH_TOP([
 #define TGETENT_OK  1
 
 /*
+ * HAVE_ANSI_PROTOS	is 1 if your compiler supports ANSI function prototypes.
+ */
+#define HAVE_ANSI_PROTOS	1
+
+/*
  * HAVE_SYS_TYPES_H is 1 if your system has <sys/types.h>.
  */
 #define HAVE_SYS_TYPES_H	1

Modified: vendor/less/dist/cvt.c
==============================================================================
--- vendor/less/dist/cvt.c	Sat Apr 29 02:03:20 2017	(r317580)
+++ vendor/less/dist/cvt.c	Sat Apr 29 06:30:21 2017	(r317581)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1984-2016  Mark Nudelman
+ * Copyright (C) 1984-2017  Mark Nudelman
  *
  * You may distribute under the terms of either the GNU General Public
  * License or the Less License, as specified in the README file.
@@ -65,7 +65,7 @@ cvt_text(odst, osrc, chpos, lenp, ops)
 	char *dst;
 	char *edst = odst;
 	char *src;
-	register char *src_end;
+	char *src_end;
 	LWCHAR ch;
 
 	if (lenp != NULL)

Modified: vendor/less/dist/decode.c
==============================================================================
--- vendor/less/dist/decode.c	Sat Apr 29 02:03:20 2017	(r317580)
+++ vendor/less/dist/decode.c	Sat Apr 29 06:30:21 2017	(r317581)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1984-2016  Mark Nudelman
+ * Copyright (C) 1984-2017  Mark Nudelman
  *
  * You may distribute under the terms of either the GNU General Public
  * License or the Less License, as specified in the README file.
@@ -237,9 +237,9 @@ expand_special_keys(table, len)
 	char *table;
 	int len;
 {
-	register char *fm;
-	register char *to;
-	register int a;
+	char *fm;
+	char *to;
+	int a;
 	char *repl;
 	int klen;
 
@@ -329,7 +329,7 @@ add_cmd_table(tlist, buf, len)
 	char *buf;
 	int len;
 {
-	register struct tablelist *t;
+	struct tablelist *t;
 
 	if (len == 0)
 		return (0);
@@ -397,9 +397,9 @@ cmd_search(cmd, table, endtable, sp)
 	char *endtable;
 	char **sp;
 {
-	register char *p;
-	register char *q;
-	register int a;
+	char *p;
+	char *q;
+	int a;
 
 	*sp = NULL;
 	for (p = table, q = cmd;  p < endtable;  p++, q++)
@@ -488,8 +488,8 @@ cmd_decode(tlist, cmd, sp)
 	char *cmd;
 	char **sp;
 {
-	register struct tablelist *t;
-	register int action = A_INVALID;
+	struct tablelist *t;
+	int action = A_INVALID;
 
 	/*
 	 * Search thru all the command tables.
@@ -599,8 +599,8 @@ new_lesskey(buf, len, sysvar)
 	int sysvar;
 {
 	char *p;
-	register int c;
-	register int n;
+	int c;
+	int n;
 
 	/*
 	 * New-style lesskey file.
@@ -651,10 +651,10 @@ lesskey(filename, sysvar)
 	char *filename;
 	int sysvar;
 {
-	register char *buf;
-	register POSITION len;
-	register long n;
-	register int f;
+	char *buf;
+	POSITION len;
+	long n;
+	int f;
 
 	if (secure)
 		return (1);

Modified: vendor/less/dist/defines.ds
==============================================================================
--- vendor/less/dist/defines.ds	Sat Apr 29 02:03:20 2017	(r317580)
+++ vendor/less/dist/defines.ds	Sat Apr 29 06:30:21 2017	(r317581)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1984-2016  Mark Nudelman
+ * Copyright (C) 1984-2017  Mark Nudelman
  *
  * You may distribute under the terms of either the GNU General Public
  * License or the Less License, as specified in the README file.
@@ -146,6 +146,11 @@
 #define	PATHNAME_SEP	"\\"
 
 /*
+ * HAVE_ANSI_PROTOS	is 1 if your compiler supports ANSI function prototypes.
+ */
+#define HAVE_ANSI_PROTOS	1
+
+/*
  * HAVE_SYS_TYPES_H is 1 if your system has <sys/types.h>.
  */
 #define HAVE_SYS_TYPES_H	1

Modified: vendor/less/dist/defines.h.in
==============================================================================
--- vendor/less/dist/defines.h.in	Sat Apr 29 02:03:20 2017	(r317580)
+++ vendor/less/dist/defines.h.in	Sat Apr 29 06:30:21 2017	(r317581)
@@ -134,6 +134,11 @@
 #define TGETENT_OK  1
 
 /*
+ * HAVE_ANSI_PROTOS	is 1 if your compiler supports ANSI function prototypes.
+ */
+#define HAVE_ANSI_PROTOS	1
+
+/*
  * HAVE_SYS_TYPES_H is 1 if your system has <sys/types.h>.
  */
 #define HAVE_SYS_TYPES_H	1

Modified: vendor/less/dist/defines.o2
==============================================================================
--- vendor/less/dist/defines.o2	Sat Apr 29 02:03:20 2017	(r317580)
+++ vendor/less/dist/defines.o2	Sat Apr 29 06:30:21 2017	(r317581)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1984-2016  Mark Nudelman
+ * Copyright (C) 1984-2017  Mark Nudelman
  *
  * You may distribute under the terms of either the GNU General Public
  * License or the Less License, as specified in the README file.
@@ -127,6 +127,11 @@
 #define	PATHNAME_SEP	"\\"
 
 /*
+ * HAVE_ANSI_PROTOS	is 1 if your compiler supports ANSI function prototypes.
+ */
+#define HAVE_ANSI_PROTOS	1
+
+/*
  * HAVE_SYS_TYPES_H is 1 if your system has <sys/types.h>.
  */
 #define HAVE_SYS_TYPES_H	1

Modified: vendor/less/dist/defines.o9
==============================================================================
--- vendor/less/dist/defines.o9	Sat Apr 29 02:03:20 2017	(r317580)
+++ vendor/less/dist/defines.o9	Sat Apr 29 06:30:21 2017	(r317581)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1984-2016  Mark Nudelman
+ * Copyright (C) 1984-2017  Mark Nudelman
  *
  * You may distribute under the terms of either the GNU General Public
  * License or the Less License, as specified in the README file.
@@ -130,6 +130,11 @@
 #define	PATHNAME_SEP	"/"
 
 /*
+ * HAVE_ANSI_PROTOS	is 1 if your compiler supports ANSI function prototypes.
+ */
+#define HAVE_ANSI_PROTOS	1
+
+/*
  * HAVE_SYS_TYPES_H is 1 if your system has <sys/types.h>.
  */
 #define HAVE_SYS_TYPES_H 0

Modified: vendor/less/dist/defines.wn
==============================================================================
--- vendor/less/dist/defines.wn	Sat Apr 29 02:03:20 2017	(r317580)
+++ vendor/less/dist/defines.wn	Sat Apr 29 06:30:21 2017	(r317581)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1984-2016  Mark Nudelman
+ * Copyright (C) 1984-2017  Mark Nudelman
  *
  * You may distribute under the terms of either the GNU General Public
  * License or the Less License, as specified in the README file.
@@ -128,6 +128,11 @@
 #define	PATHNAME_SEP	"\\"
 
 /*
+ * HAVE_ANSI_PROTOS	is 1 if your compiler supports ANSI function prototypes.
+ */
+#define HAVE_ANSI_PROTOS	1
+
+/*
  * HAVE_SYS_TYPES_H is 1 if your system has <sys/types.h>.
  */
 #define HAVE_SYS_TYPES_H	1

Modified: vendor/less/dist/edit.c
==============================================================================
--- vendor/less/dist/edit.c	Sat Apr 29 02:03:20 2017	(r317580)
+++ vendor/less/dist/edit.c	Sat Apr 29 06:30:21 2017	(r317581)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1984-2016  Mark Nudelman
+ * Copyright (C) 1984-2017  Mark Nudelman
  *
  * You may distribute under the terms of either the GNU General Public
  * License or the Less License, as specified in the README file.
@@ -26,7 +26,7 @@ extern int sigs;
 extern IFILE curr_ifile;
 extern IFILE old_ifile;
 extern struct scrpos initial_scrpos;
-extern void constant *ml_examine;
+extern void *ml_examine;
 #if SPACES_IN_FILENAMES
 extern char openquote;
 extern char closequote;
@@ -716,7 +716,7 @@ edit_stdin()
 	public void
 cat_file()
 {
-	register int c;
+	int c;
 
 	while ((c = ch_forw_get()) != EOI)
 		putchr(c);
@@ -734,8 +734,8 @@ cat_file()
 use_logfile(filename)
 	char *filename;
 {
-	register int exists;
-	register int answer;
+	int exists;
+	int answer;
 	PARG parg;
 
 	if (ch_getflags() & CH_CANSEEK)

Modified: vendor/less/dist/filename.c
==============================================================================
--- vendor/less/dist/filename.c	Sat Apr 29 02:03:20 2017	(r317580)
+++ vendor/less/dist/filename.c	Sat Apr 29 06:30:21 2017	(r317581)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1984-2016  Mark Nudelman
+ * Copyright (C) 1984-2017  Mark Nudelman
  *
  * You may distribute under the terms of either the GNU General Public
  * License or the Less License, as specified in the README file.
@@ -264,7 +264,7 @@ dirfile(dirname, filename)
 homefile(filename)
 	char *filename;
 {
-	register char *pathname;
+	char *pathname;
 
 	/*
 	 * Try $HOME/filename.
@@ -314,9 +314,9 @@ homefile(filename)
 fexpand(s)
 	char *s;
 {
-	register char *fr, *to;
-	register int n;
-	register char *e;
+	char *fr, *to;
+	int n;
+	char *e;
 	IFILE ifile;
 
 #define	fchar_ifile(c) \
@@ -690,9 +690,9 @@ lglob(filename)
 	 * The globbing function returns a single name, and
 	 * is called multiple times to walk thru all names.
 	 */
-	register char *p;
-	register int len;
-	register int n;
+	char *p;
+	int len;
+	int n;
 	char *pathname;
 	char *qpathname;
 	DECL_GLOB_NAME(fnd,drive,dir,fname,ext,handle)
@@ -1018,7 +1018,7 @@ is_dir(filename)
 #else
 #ifdef _OSK
 {
-	register int f;
+	int f;
 
 	f = open(filename, S_IREAD | S_IFDIR);
 	if (f >= 0)
@@ -1040,7 +1040,7 @@ is_dir(filename)
 bad_file(filename)
 	char *filename;
 {
-	register char *m = NULL;
+	char *m = NULL;
 
 	filename = shell_unquote(filename);
 	if (!force_open && is_dir(filename))

Modified: vendor/less/dist/forwback.c
==============================================================================
--- vendor/less/dist/forwback.c	Sat Apr 29 02:03:20 2017	(r317580)
+++ vendor/less/dist/forwback.c	Sat Apr 29 06:30:21 2017	(r317581)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1984-2016  Mark Nudelman
+ * Copyright (C) 1984-2017  Mark Nudelman
  *
  * You may distribute under the terms of either the GNU General Public
  * License or the Less License, as specified in the README file.
@@ -124,7 +124,7 @@ squish_check()
  */
 	public void
 forw(n, pos, force, only_last, nblank)
-	register int n;
+	int n;
 	POSITION pos;
 	int force;
 	int only_last;
@@ -298,7 +298,7 @@ forw(n, pos, force, only_last, nblank)
  */
 	public void
 back(n, pos, force, only_last)
-	register int n;
+	int n;
 	POSITION pos;
 	int force;
 	int only_last;
@@ -444,3 +444,21 @@ get_back_scroll()
 		return (sc_height - 2);
 	return (10000); /* infinity */
 }
+
+/*
+ * Get line count of file up to the screen height + 1 char
+ */
+	public int
+get_line_count()
+{
+	int nlines;
+	POSITION pos;
+
+	pos = ch_zero();
+	for (nlines = 0;  nlines <= sc_height;  nlines++)
+	{
+		pos = forw_line(pos);
+		if (pos == NULL_POSITION) break;
+	}
+	return nlines;
+}

Modified: vendor/less/dist/funcs.h
==============================================================================
--- vendor/less/dist/funcs.h	Sat Apr 29 02:03:20 2017	(r317580)
+++ vendor/less/dist/funcs.h	Sat Apr 29 06:30:21 2017	(r317581)
@@ -1,299 +1,300 @@
-	public char * save ();
-	public VOID_POINTER ecalloc ();
-	public char * skipsp ();
-	public int sprefix ();

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201704290630.v3T6ULRU092449>