pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/net/tnftp/files tnftp 20050511.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/7ccdbf64feac
branches:  trunk
changeset: 493648:7ccdbf64feac
user:      lukem <lukem%pkgsrc.org@localhost>
date:      Wed May 11 08:11:55 2005 +0000

description:
tnftp 20050511.
Notable changes:
* Improve timeout handling during connection initiation
* Prevent coredump with long command lines when editing is enabled.

diffstat:

 net/tnftp/files/Makefile.in                 |     2 +-
 net/tnftp/files/THANKS                      |    16 +-
 net/tnftp/files/aclocal.m4                  |     2 +-
 net/tnftp/files/libedit/Makefile.in         |     3 +-
 net/tnftp/files/libedit/chared.c            |   321 ++-
 net/tnftp/files/libedit/chared.h            |    52 +-
 net/tnftp/files/libedit/common.c            |   223 +-
 net/tnftp/files/libedit/editline.3          |   165 +-
 net/tnftp/files/libedit/editrc.5            |    43 +-
 net/tnftp/files/libedit/el.c                |    73 +-
 net/tnftp/files/libedit/el.h                |    29 +-
 net/tnftp/files/libedit/emacs.c             |   116 +-
 net/tnftp/files/libedit/hist.c              |    71 +-
 net/tnftp/files/libedit/hist.h              |    13 +-
 net/tnftp/files/libedit/histedit.h          |    42 +-
 net/tnftp/files/libedit/history.c           |   210 +-
 net/tnftp/files/libedit/key.c               |    23 +-
 net/tnftp/files/libedit/key.h               |    13 +-
 net/tnftp/files/libedit/makelist.in         |    14 +-
 net/tnftp/files/libedit/map.c               |   314 ++-
 net/tnftp/files/libedit/map.h               |     9 +-
 net/tnftp/files/libedit/parse.c             |    36 +-
 net/tnftp/files/libedit/parse.h             |     9 +-
 net/tnftp/files/libedit/prompt.c            |    26 +-
 net/tnftp/files/libedit/prompt.h            |     9 +-
 net/tnftp/files/libedit/read.c              |   176 +-
 net/tnftp/files/libedit/read.h              |     5 +-
 net/tnftp/files/libedit/readline.c          |  2143 +++++++++++++++++++++++++++
 net/tnftp/files/libedit/readline/readline.h |    80 +-
 net/tnftp/files/libedit/refresh.c           |    57 +-
 net/tnftp/files/libedit/refresh.h           |     9 +-
 net/tnftp/files/libedit/search.c            |   214 +-
 net/tnftp/files/libedit/search.h            |    15 +-
 net/tnftp/files/libedit/sig.c               |    26 +-
 net/tnftp/files/libedit/sig.h               |    17 +-
 net/tnftp/files/libedit/sys.h               |    86 +-
 net/tnftp/files/libedit/term.c              |    57 +-
 net/tnftp/files/libedit/term.h              |    11 +-
 net/tnftp/files/libedit/tokenizer.c         |   122 +-
 net/tnftp/files/libedit/tty.c               |   157 +-
 net/tnftp/files/libedit/tty.h               |     9 +-
 net/tnftp/files/libedit/vi.c                |   829 ++++++---
 net/tnftp/files/libnetbsd/Makefile.in       |     3 +-
 net/tnftp/files/libnetbsd/err.c             |     2 +-
 net/tnftp/files/libnetbsd/fgetln.c          |     2 +-
 net/tnftp/files/libnetbsd/fparseln.c        |     4 +-
 net/tnftp/files/libnetbsd/fseeko.c          |     2 +-
 net/tnftp/files/libnetbsd/ftpglob.h         |     4 +-
 net/tnftp/files/libnetbsd/ftpvis.h          |     3 +-
 net/tnftp/files/libnetbsd/getaddrinfo.c     |     4 +-
 net/tnftp/files/libnetbsd/getnameinfo.c     |     5 +-
 net/tnftp/files/libnetbsd/glob.c            |     4 +-
 net/tnftp/files/libnetbsd/inet_ntop.c       |     4 +-
 net/tnftp/files/libnetbsd/inet_pton.c       |     4 +-
 net/tnftp/files/libnetbsd/mkstemp.c         |     4 +-
 net/tnftp/files/libnetbsd/setprogname.c     |     4 +-
 net/tnftp/files/libnetbsd/sl_init.c         |     4 +-
 net/tnftp/files/libnetbsd/snprintf.c        |     2 +-
 net/tnftp/files/libnetbsd/strdup.c          |     4 +-
 net/tnftp/files/libnetbsd/strerror.c        |     2 +-
 net/tnftp/files/libnetbsd/strlcat.c         |     4 +-
 net/tnftp/files/libnetbsd/strlcpy.c         |     4 +-
 net/tnftp/files/libnetbsd/strptime.c        |     4 +-
 net/tnftp/files/libnetbsd/strsep.c          |     4 +-
 net/tnftp/files/libnetbsd/strtoll.c         |     4 +-
 net/tnftp/files/libnetbsd/strunvis.c        |     4 +-
 net/tnftp/files/libnetbsd/strvis.c          |     4 +-
 net/tnftp/files/libnetbsd/timegm.c          |     3 +-
 net/tnftp/files/libnetbsd/usleep.c          |     3 +-
 net/tnftp/files/src/Makefile.in             |     3 +-
 net/tnftp/files/src/complete.c              |    10 +-
 71 files changed, 4615 insertions(+), 1340 deletions(-)

diffs (truncated from 9537 to 300 lines):

diff -r afe5142d5b1e -r 7ccdbf64feac net/tnftp/files/Makefile.in
--- a/net/tnftp/files/Makefile.in       Wed May 11 05:44:58 2005 +0000
+++ b/net/tnftp/files/Makefile.in       Wed May 11 08:11:55 2005 +0000
@@ -1,4 +1,4 @@
-# $Id: Makefile.in,v 1.1 2004/03/11 13:01:01 grant Exp $
+#      NetBSD: Makefile.in,v 1.3 2005/05/11 03:03:42 lukem Exp
 #
 
 srcdir = @srcdir@
diff -r afe5142d5b1e -r 7ccdbf64feac net/tnftp/files/THANKS
--- a/net/tnftp/files/THANKS    Wed May 11 05:44:58 2005 +0000
+++ b/net/tnftp/files/THANKS    Wed May 11 08:11:55 2005 +0000
@@ -1,9 +1,10 @@
 Whilst a lot of the work in tnftp (both the original sources in NetBSD
 and this port) was done by Luke Mewburn, it would not be as usable
-without the enhancements, fixes, or input from the following people:
+without the enhancements, bug fixes, or input from the following people:
 
 Amitai Schlair                 <schmonz%schmonz.com@localhost>
 Anders Dinsen                  <anders%dinsen.net@localhost>
+Anders Magnusson               <ragge%ltu.se@localhost>
 Arkadiusz Miskiewicz           <misiek%pld.org.pl@localhost>
 Brian Stark                    <bstark1990%netscape.net@localhost>
 Chris G. Demetriou             <cgd%NetBSD.org@localhost>
@@ -14,6 +15,7 @@
 David Carrel                   <carrel%NetBSD.org@localhost>
 DervishD                       <raul%pleyades.net@localhost>
 Douwe Kiela                    <virtus%wanadoo.nl@localhost>
+Eugene Kotlyarov               <ekot%protek36.esoo.ru@localhost>
 Geoff Wing                     <mason%primenet.com.au@localhost>
 Giles Lean                     <giles%nemeton.com.au@localhost>
 Havard Eidnes                  <Havard.Eidnes%runit.sintef.no@localhost>
@@ -28,18 +30,24 @@
 Launey Thomas                  <ljt%alum.mit.edu@localhost>
 Luke Mewburn                   <lukem%NetBSD.org@localhost>
 Marc Horowitz                  <marc%mit.edu@localhost>
+Mathieu Arnold                 <mat%FreeBSD.org@localhost>
 Matthew R. Green               <mrg%eterna.com.au@localhost>
 Matthias Pfaller               <leo%dachau.marco.de@localhost>
 Matthias Scheler               <tron%zhadum.de@localhost>
-Maxim Konovalov                        <maxim%freebsd.org@localhost>
+Maxim Konovalov                        <maxim%FreeBSD.org@localhost>
+Maxime Henrion                 <mux%FreeBSD.org@localhost>
 Michael L. Hitch               <osymh%terra.oscs.montana.edu@localhost>
-Mike Heffner                   <mikeh%freebsd.org@localhost>
+Mike Heffner                   <mikeh%FreeBSD.org@localhost>
+Onno van der Linden            <o.vd.linden%quicknet.nl@localhost>
 Ruslan Ermilov                 <ru%FreeBSD.org@localhost>
+Ryoji Kanai                    <rkanai%eeye.com@localhost>
 Scott Aaron Bamford            <sab%ansic.net@localhost>
 Simon Burge                    <simonb%thistledown.com.au@localhost>
 Steve McClellan                        <steve.mcclellan%radisys.com@localhost>
+TAMURA Kent                    <kent%NetBSD.org@localhost>
+Stoned Elipot                  <seb%NetBSD.org@localhost>
 Todd C. Miller                 <Todd.Miller%courtesan.com@localhost>
 YAMANO Yuji                    <yyamano%NetBSD.org@localhost>
-Yar Tikhiy                     <yar%freebsd.org@localhost>
+Yar Tikhiy                     <yar%FreeBSD.org@localhost>
 
 Apologies to anyone missed.
diff -r afe5142d5b1e -r 7ccdbf64feac net/tnftp/files/aclocal.m4
--- a/net/tnftp/files/aclocal.m4        Wed May 11 05:44:58 2005 +0000
+++ b/net/tnftp/files/aclocal.m4        Wed May 11 08:11:55 2005 +0000
@@ -1,4 +1,4 @@
-dnl $Id: aclocal.m4,v 1.1 2004/03/11 13:01:01 grant Exp $
+dnl    NetBSD: aclocal.m4,v 1.3 2005/05/11 03:03:42 lukem Exp
 dnl
 
 dnl
diff -r afe5142d5b1e -r 7ccdbf64feac net/tnftp/files/libedit/Makefile.in
--- a/net/tnftp/files/libedit/Makefile.in       Wed May 11 05:44:58 2005 +0000
+++ b/net/tnftp/files/libedit/Makefile.in       Wed May 11 08:11:55 2005 +0000
@@ -1,5 +1,4 @@
-#
-#      $Id: Makefile.in,v 1.1 2004/03/11 13:01:01 grant Exp $
+#      NetBSD: Makefile.in,v 1.2 2005/05/11 01:17:39 lukem Exp
 #
 
 srcdir = @srcdir@
diff -r afe5142d5b1e -r 7ccdbf64feac net/tnftp/files/libedit/chared.c
--- a/net/tnftp/files/libedit/chared.c  Wed May 11 05:44:58 2005 +0000
+++ b/net/tnftp/files/libedit/chared.c  Wed May 11 08:11:55 2005 +0000
@@ -1,4 +1,5 @@
-/*     $NetBSD: chared.c,v 1.1 2004/03/11 13:01:01 grant Exp $ */
+/*     NetBSD: chared.c,v 1.4 2005/05/11 01:17:39 lukem Exp    */
+/*     from    NetBSD: chared.c,v 1.22 2004/08/13 12:10:38 mycroft Exp */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -15,11 +16,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by the University of
- *     California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  *
@@ -39,6 +36,17 @@
 #include "tnftp.h"
 #include "sys.h"
 
+#if 0
+#include "config.h"
+#if !defined(lint) && !defined(SCCSID)
+#if 0
+static char sccsid[] = "@(#)chared.c   8.1 (Berkeley) 6/4/93";
+#else
+__RCSID("NetBSD: chared.c,v 1.4 2005/05/11 01:17:39 lukem Exp");
+#endif
+#endif /* not lint && not SCCSID */
+#endif
+
 /*
  * chared.c: Character editor utilities
  */
@@ -52,17 +60,36 @@
  *     Handle state for the vi undo command
  */
 protected void
-cv_undo(EditLine *el,int action, size_t size, char *ptr)
+cv_undo(EditLine *el)
 {
        c_undo_t *vu = &el->el_chared.c_undo;
-       vu->action = action;
-       vu->ptr    = ptr;
-       vu->isize  = size;
-       (void) memcpy(vu->buf, vu->ptr, size);
-#ifdef DEBUG_UNDO
-       (void) fprintf(el->el_errfile, "Undo buffer \"%s\" size = +%d -%d\n",
-              vu->ptr, vu->isize, vu->dsize);
-#endif
+       c_redo_t *r = &el->el_chared.c_redo;
+       uint size;
+
+       /* Save entire line for undo */
+       size = el->el_line.lastchar - el->el_line.buffer;
+       vu->len = size;
+       vu->cursor = el->el_line.cursor - el->el_line.buffer;
+       memcpy(vu->buf, el->el_line.buffer, size);
+
+       /* save command info for redo */
+       r->count = el->el_state.doingarg ? el->el_state.argument : 0;
+       r->action = el->el_chared.c_vcmd.action;
+       r->pos = r->buf;
+       r->cmd = el->el_state.thiscmd;
+       r->ch = el->el_state.thisch;
+}
+
+/* cv_yank():
+ *     Save yank/delete data for paste
+ */
+protected void
+cv_yank(EditLine *el, const char *ptr, int size)
+{
+       c_kill_t *k = &el->el_chared.c_kill;
+
+       memcpy(k->buf, ptr, size +0u);
+       k->last = k->buf + size;
 }
 
 
@@ -74,8 +101,10 @@
 {
        char *cp;
 
-       if (el->el_line.lastchar + num >= el->el_line.limit)
-               return;                 /* can't go past end of buffer */
+       if (el->el_line.lastchar + num >= el->el_line.limit) {
+               if (!ch_enlargebufs(el, num +0u))
+                       return;         /* can't go past end of buffer */
+       }
 
        if (el->el_line.cursor < el->el_line.lastchar) {
                /* if I must move chars */
@@ -96,12 +125,14 @@
        if (el->el_line.cursor + num > el->el_line.lastchar)
                num = el->el_line.lastchar - el->el_line.cursor;
 
+       if (el->el_map.current != el->el_map.emacs) {
+               cv_undo(el);
+               cv_yank(el, el->el_line.cursor, num);
+       }
+
        if (num > 0) {
                char *cp;
 
-               if (el->el_map.current != el->el_map.emacs)
-                       cv_undo(el, INSERT, (size_t)num, el->el_line.cursor);
-
                for (cp = el->el_line.cursor; cp <= el->el_line.lastchar; cp++)
                        *cp = cp[num];
 
@@ -110,6 +141,21 @@
 }
 
 
+/* c_delafter1():
+ *     Delete the character after the cursor, do not yank
+ */
+protected void
+c_delafter1(EditLine *el)
+{
+       char *cp;
+
+       for (cp = el->el_line.cursor; cp <= el->el_line.lastchar; cp++)
+               *cp = cp[1];
+
+       el->el_line.lastchar--;
+}
+
+
 /* c_delbefore():
  *     Delete num characters before the cursor
  */
@@ -120,13 +166,14 @@
        if (el->el_line.cursor - num < el->el_line.buffer)
                num = el->el_line.cursor - el->el_line.buffer;
 
+       if (el->el_map.current != el->el_map.emacs) {
+               cv_undo(el);
+               cv_yank(el, el->el_line.cursor - num, num);
+       }
+
        if (num > 0) {
                char *cp;
 
-               if (el->el_map.current != el->el_map.emacs)
-                       cv_undo(el, INSERT, (size_t)num,
-                           el->el_line.cursor - num);
-
                for (cp = el->el_line.cursor - num;
                    cp <= el->el_line.lastchar;
                    cp++)
@@ -137,13 +184,28 @@
 }
 
 
+/* c_delbefore1():
+ *     Delete the character before the cursor, do not yank
+ */
+protected void
+c_delbefore1(EditLine *el)
+{
+       char *cp;
+
+       for (cp = el->el_line.cursor - 1; cp <= el->el_line.lastchar; cp++)
+               *cp = cp[1];
+
+       el->el_line.lastchar--;
+}
+
+
 /* ce__isword():
  *     Return if p is part of a word according to emacs
  */
 protected int
 ce__isword(int p)
 {
-       return (isalpha(p) || isdigit(p) || strchr("*?_-.[]~=", p) != NULL);
+       return (isalnum(p) || strchr("*?_-.[]~=", p) != NULL);
 }
 
 
@@ -153,6 +215,20 @@
 protected int
 cv__isword(int p)
 {
+       if (isalnum(p) || p == '_')
+               return 1;
+       if (isgraph(p))
+               return 2;
+       return 0;
+}
+
+
+/* cv__isWord():
+ *     Return if p is part of a big word according to vi
+ */
+protected int
+cv__isWord(int p)
+{
        return (!isspace(p));
 }
 
@@ -215,7 +291,7 @@
                 * vi historically deletes with cw only the word preserving the
                 * trailing whitespace! This is not what 'w' does..
                 */
-               if (el->el_chared.c_vcmd.action != (DELETE|INSERT))
+               if (n || el->el_chared.c_vcmd.action != (DELETE|INSERT))
                        while ((p < high) && isspace((unsigned char) *p))
                                p++;
        }
@@ -232,26 +308,19 @@
  *     Find the previous word vi style



Home | Main Index | Thread Index | Old Index