Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/less merge less 381



details:   https://anonhg.NetBSD.org/src/rev/7c853a6ffd8f
branches:  trunk
changeset: 545662:7c853a6ffd8f
user:      mrg <mrg%NetBSD.org@localhost>
date:      Mon Apr 14 02:56:45 2003 +0000

description:
merge less 381

diffstat:

 usr.bin/less/less/acconfig.h     |   76 ---------
 usr.bin/less/less/brac.c         |    4 +-
 usr.bin/less/less/ch.c           |    7 +-
 usr.bin/less/less/charset.c      |    5 +-
 usr.bin/less/less/cmdbuf.c       |   25 +-
 usr.bin/less/less/command.c      |   65 ++++---
 usr.bin/less/less/decode.c       |    4 +-
 usr.bin/less/less/defines.h      |  325 ++++++++++++++++++++++----------------
 usr.bin/less/less/edit.c         |    4 +-
 usr.bin/less/less/filename.c     |   13 +-
 usr.bin/less/less/forwback.c     |    7 +-
 usr.bin/less/less/funcs.h        |    8 +-
 usr.bin/less/less/help.c         |    8 +-
 usr.bin/less/less/ifile.c        |    4 +-
 usr.bin/less/less/less.1         |   42 +++--
 usr.bin/less/less/less.h         |   11 +-
 usr.bin/less/less/line.c         |   95 ++++++++---
 usr.bin/less/less/linenum.c      |   90 +++++-----
 usr.bin/less/less/lsystem.c      |    9 +-
 usr.bin/less/less/main.c         |   36 +---
 usr.bin/less/less/mark.c         |    5 +-
 usr.bin/less/less/option.c       |   15 +-
 usr.bin/less/less/option.h       |    5 +-
 usr.bin/less/less/opttbl.c       |  276 ++++++++++++++++++++++----------
 usr.bin/less/less/os.c           |    4 +-
 usr.bin/less/less/output.c       |  238 +++++++++++++++++++++++++---
 usr.bin/less/less/prompt.c       |   88 ++++++---
 usr.bin/less/less/screen.c       |   27 +-
 usr.bin/less/less/search.c       |  128 ++++++++++-----
 usr.bin/less/less/signal.c       |    4 +-
 usr.bin/less/less/tags.c         |   24 +-
 usr.bin/less/less/version.c      |   26 ++-
 usr.bin/less/less2netbsd         |   12 +-
 usr.bin/less/lessecho/lessecho.c |   15 +-
 usr.bin/less/lesskey/lesskey.1   |    6 +-
 usr.bin/less/lesskey/lesskey.c   |   75 ++++----
 36 files changed, 1102 insertions(+), 684 deletions(-)

diffs (truncated from 3676 to 300 lines):

diff -r 234986917adc -r 7c853a6ffd8f usr.bin/less/less/acconfig.h
--- a/usr.bin/less/less/acconfig.h      Mon Apr 14 02:09:56 2003 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 1984-2000  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.
- *
- * For more information about less, or for information on how to 
- * contact the author, see the README file.
- */
-
-
-/*
- * Regular expression library.
- * Define exactly one of the following to be 1:
- * HAVE_POSIX_REGCOMP: POSIX regcomp() and regex.h
- * HAVE_PCRE: PCRE (Perl-compatible regular expression) library
- * HAVE_RE_COMP: BSD re_comp()
- * HAVE_REGCMP: System V regcmp()
- * HAVE_V8_REGCOMP: Henry Spencer V8 regcomp() and regexp.h
- * NO_REGEX: pattern matching is supported, but without metacharacters.
- */
-#undef HAVE_POSIX_REGCOMP
-#undef HAVE_PCRE
-#undef HAVE_RE_COMP
-#undef HAVE_REGCMP
-#undef HAVE_V8_REGCOMP
-#undef NO_REGEX
-#undef HAVE_REGEXEC2
-
-/* Define HAVE_VOID if your compiler supports the "void" type. */
-#undef HAVE_VOID
-
-/* Define HAVE_CONST if your compiler supports the "const" modifier. */
-#undef HAVE_CONST
-
-/* Define HAVE_TIME_T if your system supports the "time_t" type. */
-#undef HAVE_TIME_T
-
-/* Define HAVE_STRERROR if you have the strerror() function. */
-#undef HAVE_STRERROR
-
-/* Define HAVE_FILENO if you have the fileno() macro. */
-#undef HAVE_FILENO
-
-/* Define HAVE_ERRNO if you have the errno variable */
-/* Define MUST_DEFINE_ERRNO if you have errno but it is not define 
- * in errno.h */
-#undef HAVE_ERRNO
-#undef MUST_DEFINE_ERRNO
-
-/* Define HAVE_SYS_ERRLIST if you have the sys_errlist[] variable */
-#undef HAVE_SYS_ERRLIST
-
-/* Define HAVE_OSPEED if your termcap library has the ospeed variable */
-/* Define MUST_DEFINE_OSPEED if you have ospeed but it is not defined
- * in termcap.h. */
-#undef HAVE_OSPEED
-#undef MUST_DEFINE_OSPEED
-
-/* Define HAVE_LOCALE if you have locale.h and setlocale. */
-#undef HAVE_LOCALE
-
-/* Define HAVE_TERMIOS_FUNCS if you have tcgetattr/tcsetattr */
-#undef HAVE_TERMIOS_FUNCS
-
-/* Define HAVE_UPPER_LOWER if you have isupper, islower, toupper, tolower */
-#undef HAVE_UPPER_LOWER
-
-/* Define HAVE_SIGSET_T you have the sigset_t type */
-#undef HAVE_SIGSET_T
-
-/* Define HAVE_SIGEMPTYSET if you have the sigemptyset macro */
-#undef HAVE_SIGEMPTYSET
-
-/* Define EDIT_PGM to your editor. */
-#define EDIT_PGM       "vi"
diff -r 234986917adc -r 7c853a6ffd8f usr.bin/less/less/brac.c
--- a/usr.bin/less/less/brac.c  Mon Apr 14 02:09:56 2003 +0000
+++ b/usr.bin/less/less/brac.c  Mon Apr 14 02:56:45 2003 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: brac.c,v 1.4 2001/07/26 13:43:43 mrg Exp $     */
+/*     $NetBSD: brac.c,v 1.5 2003/04/14 02:56:46 mrg Exp $     */
 
 /*
- * Copyright (C) 1984-2000  Mark Nudelman
+ * Copyright (C) 1984-2002  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.
diff -r 234986917adc -r 7c853a6ffd8f usr.bin/less/less/ch.c
--- a/usr.bin/less/less/ch.c    Mon Apr 14 02:09:56 2003 +0000
+++ b/usr.bin/less/less/ch.c    Mon Apr 14 02:56:45 2003 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: ch.c,v 1.6 2003/01/20 05:30:12 simonb Exp $    */
+/*     $NetBSD: ch.c,v 1.7 2003/04/14 02:56:46 mrg Exp $       */
 
 /*
- * Copyright (C) 1984-2000  Mark Nudelman
+ * Copyright (C) 1984-2002  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.
@@ -108,10 +108,11 @@
 extern char *namelogfile;
 #endif
 
+static int ch_addbuf __P((void));
 static int buffered __P((BLOCKNUM));
-static int ch_addbuf __P((void));
 static void ch_delbufs __P((void));
 
+
 /*
  * Get the character pointed to by the read pointer.
  * ch_get() is a macro which is more efficient to call
diff -r 234986917adc -r 7c853a6ffd8f usr.bin/less/less/charset.c
--- a/usr.bin/less/less/charset.c       Mon Apr 14 02:09:56 2003 +0000
+++ b/usr.bin/less/less/charset.c       Mon Apr 14 02:56:45 2003 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: charset.c,v 1.5 2002/03/05 12:28:31 mrg Exp $  */
+/*     $NetBSD: charset.c,v 1.6 2003/04/14 02:56:46 mrg Exp $  */
 
 /*
- * Copyright (C) 1984-2000  Mark Nudelman
+ * Copyright (C) 1984-2002  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.
@@ -169,6 +169,7 @@
        error("invalid charset name", NULL_PARG);
        quit(QUIT_ERROR);
        /*NOTREACHED*/
+       return (0);
 }
 
 #if HAVE_LOCALE
diff -r 234986917adc -r 7c853a6ffd8f usr.bin/less/less/cmdbuf.c
--- a/usr.bin/less/less/cmdbuf.c        Mon Apr 14 02:09:56 2003 +0000
+++ b/usr.bin/less/less/cmdbuf.c        Mon Apr 14 02:56:45 2003 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: cmdbuf.c,v 1.5 2002/03/05 12:28:32 mrg Exp $   */
+/*     $NetBSD: cmdbuf.c,v 1.6 2003/04/14 02:56:46 mrg Exp $   */
 
 /*
- * Copyright (C) 1984-2000  Mark Nudelman
+ * Copyright (C) 1984-2002  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.
@@ -82,25 +82,25 @@
  */
 struct mlist mlist_search =  
        { &mlist_search,  &mlist_search,  &mlist_search,  NULL };
-public void constant *ml_search = (void *) &mlist_search;
+public void * constant ml_search = (void *) &mlist_search;
 
 struct mlist mlist_examine = 
        { &mlist_examine, &mlist_examine, &mlist_examine, NULL };
-public void constant *ml_examine = (void *) &mlist_examine;
+public void * constant ml_examine = (void *) &mlist_examine;
 
 #if SHELL_ESCAPE || PIPEC
 struct mlist mlist_shell =   
        { &mlist_shell,   &mlist_shell,   &mlist_shell,   NULL };
-public void constant *ml_shell = (void *) &mlist_shell;
+public void * constant 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 * constant ml_search = (void *)1;
+public void * constant ml_examine = (void *)2;
 #if SHELL_ESCAPE || PIPEC
-public void constant *ml_shell = (void *)3;
+public void * constant ml_shell = (void *)3;
 #endif
 
 #endif /* CMD_HISTORY */
@@ -1048,10 +1048,15 @@
 /*
  * Return the number currently in the command buffer.
  */
-       public int
+       public LINENUM
 cmd_int()
 {
-       return (atoi(cmdbuf));
+       register char *p;
+       LINENUM n = 0;
+
+       for (p = cmdbuf;  *p != '\0';  p++)
+               n = (10 * n) + (*p - '0');
+       return (n);
 }
 
 /*
diff -r 234986917adc -r 7c853a6ffd8f usr.bin/less/less/command.c
--- a/usr.bin/less/less/command.c       Mon Apr 14 02:09:56 2003 +0000
+++ b/usr.bin/less/less/command.c       Mon Apr 14 02:56:45 2003 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: command.c,v 1.9 2002/03/05 12:28:32 mrg Exp $  */
+/*     $NetBSD: command.c,v 1.10 2003/04/14 02:56:46 mrg Exp $ */
 
 /*
- * Copyright (C) 1984-2000  Mark Nudelman
+ * Copyright (C) 1984-2002  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.
@@ -68,7 +68,7 @@
 #endif
 static int mca;                        /* The multicharacter command (action) */
 static int search_type;                /* The previous type of search */
-static int number;             /* The number typed by the user */
+static LINENUM number;         /* The number typed by the user */
 static char optchar;
 static int optflag;
 static int optgetname;
@@ -77,7 +77,6 @@
 static char pipec;
 #endif
 
-
 static void cmd_exec __P((void));
 static void start_mca __P((int, char *, constant void *, int));
 static void mca_search __P((void));
@@ -201,7 +200,7 @@
        {
        case A_F_SEARCH:
        case A_B_SEARCH:
-               multi_search(cbuf, number);
+               multi_search(cbuf, (int) number);
                break;
        case A_FIRSTCMD:
                /*
@@ -221,18 +220,20 @@
                optchar = '\0';
                break;
        case A_F_BRACKET:
-               match_brac(cbuf[0], cbuf[1], 1, number);
+               match_brac(cbuf[0], cbuf[1], 1, (int) number);
                break;
        case A_B_BRACKET:
-               match_brac(cbuf[1], cbuf[0], 0, number);
+               match_brac(cbuf[1], cbuf[0], 0, (int) number);
                break;
 #if EXAMINE
        case A_EXAMINE:
                if (secure)
                        break;
                edit_list(cbuf);
+#if TAGS
                /* If tag structure is loaded then clean it up. */
                cleantags();
+#endif
                break;
 #endif
 #if SHELL_ESCAPE
@@ -1008,7 +1009,7 @@
                         * Forward one window (and set the window size).
                         */
                        if (number > 0)
-                               swindow = number;
+                               swindow = (int) number;
                        /* FALLTHRU */
                case A_F_SCREEN:
                        /*
@@ -1019,7 +1020,7 @@
                        cmd_exec();
                        if (show_attn)
                                set_attnpos(bottompos);
-                       forward(number, 0, 1);
+                       forward((int) number, 0, 1);
                        break;
 
                case A_B_WINDOW:
@@ -1027,7 +1028,7 @@
                         * Backward one window (and set the window size).
                         */
                        if (number > 0)
-                               swindow = number;
+                               swindow = (int) number;
                        /* FALLTHRU */
                case A_B_SCREEN:
                        /*
@@ -1036,7 +1037,7 @@
                        if (number <= 0)
                                number = get_swindow();
                        cmd_exec();
-                       backward(number, 0, 1);
+                       backward((int) number, 0, 1);
                        break;
 



Home | Main Index | Thread Index | Old Index