Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/ftp invoke cmdtab.c_handler()s with argv[0] == c_nam...



details:   https://anonhg.NetBSD.org/src/rev/c552f82c72a8
branches:  trunk
changeset: 500664:c552f82c72a8
user:      lukem <lukem%NetBSD.org@localhost>
date:      Fri Dec 15 02:22:50 2000 +0000

description:
invoke cmdtab.c_handler()s with argv[0] == c_name instead of the
supplied name. that way the full (unambiguous) name is displayed in
error messages and usage strings.

diffstat:

 usr.bin/ftp/cmds.c    |  5 +++--
 usr.bin/ftp/domacro.c |  5 +++--
 usr.bin/ftp/main.c    |  7 ++++---
 usr.bin/ftp/version.h |  4 ++--
 4 files changed, 12 insertions(+), 9 deletions(-)

diffs (103 lines):

diff -r 47c6e42444e6 -r c552f82c72a8 usr.bin/ftp/cmds.c
--- a/usr.bin/ftp/cmds.c        Fri Dec 15 02:12:58 2000 +0000
+++ b/usr.bin/ftp/cmds.c        Fri Dec 15 02:22:50 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cmds.c,v 1.92 2000/11/15 00:10:59 lukem Exp $  */
+/*     $NetBSD: cmds.c,v 1.93 2000/12/15 02:22:50 lukem Exp $  */
 
 /*-
  * Copyright (c) 1996-2000 The NetBSD Foundation, Inc.
@@ -107,7 +107,7 @@
 #if 0
 static char sccsid[] = "@(#)cmds.c     8.6 (Berkeley) 10/9/94";
 #else
-__RCSID("$NetBSD: cmds.c,v 1.92 2000/11/15 00:10:59 lukem Exp $");
+__RCSID("$NetBSD: cmds.c,v 1.93 2000/12/15 02:22:50 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -1838,6 +1838,7 @@
        cmdpos = strcspn(line, " \t");
        if (cmdpos > 0)         /* remove leading "proxy " from input buffer */
                memmove(line, line + cmdpos + 1, strlen(line) - cmdpos + 1);
+       argv[1] = c->c_name;
        (*c->c_handler)(argc-1, argv+1);
        if (connected) {
                proxflag = 1;
diff -r 47c6e42444e6 -r c552f82c72a8 usr.bin/ftp/domacro.c
--- a/usr.bin/ftp/domacro.c     Fri Dec 15 02:12:58 2000 +0000
+++ b/usr.bin/ftp/domacro.c     Fri Dec 15 02:22:50 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: domacro.c,v 1.17 2000/07/18 06:45:03 lukem Exp $       */
+/*     $NetBSD: domacro.c,v 1.18 2000/12/15 02:22:51 lukem Exp $       */
 
 /*
  * Copyright (c) 1985, 1993, 1994
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)domacro.c  8.3 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: domacro.c,v 1.17 2000/07/18 06:45:03 lukem Exp $");
+__RCSID("$NetBSD: domacro.c,v 1.18 2000/12/15 02:22:51 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -128,6 +128,7 @@
                                fputs(line, ttyout);
                                putc('\n', ttyout);
                        }
+                       margv[0] = c->c_name;
                        (*c->c_handler)(margc, margv);
                        if (bell && c->c_bell)
                                (void)putc('\007', ttyout);
diff -r 47c6e42444e6 -r c552f82c72a8 usr.bin/ftp/main.c
--- a/usr.bin/ftp/main.c        Fri Dec 15 02:12:58 2000 +0000
+++ b/usr.bin/ftp/main.c        Fri Dec 15 02:22:50 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.74 2000/11/15 00:11:03 lukem Exp $  */
+/*     $NetBSD: main.c,v 1.75 2000/12/15 02:22:51 lukem Exp $  */
 
 /*-
  * Copyright (c) 1996-2000 The NetBSD Foundation, Inc.
@@ -108,7 +108,7 @@
 #if 0
 static char sccsid[] = "@(#)main.c     8.6 (Berkeley) 10/9/94";
 #else
-__RCSID("$NetBSD: main.c,v 1.74 2000/11/15 00:11:03 lukem Exp $");
+__RCSID("$NetBSD: main.c,v 1.75 2000/12/15 02:22:51 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -679,6 +679,7 @@
                        continue;
                }
                confirmrest = 0;
+               margv[0] = c->c_name;
                (*c->c_handler)(margc, margv);
                if (bell && c->c_bell)
                        (void)putc('\007', ttyout);
@@ -944,7 +945,7 @@
                            cmd, arg);
                else {
                        if (isusage) {
-                               nargv[0] = arg;
+                               nargv[0] = c->c_name;
                                (*c->c_handler)(0, nargv);
                        } else
                                fprintf(ttyout, "%-*s\t%s\n", HELPINDENT,
diff -r 47c6e42444e6 -r c552f82c72a8 usr.bin/ftp/version.h
--- a/usr.bin/ftp/version.h     Fri Dec 15 02:12:58 2000 +0000
+++ b/usr.bin/ftp/version.h     Fri Dec 15 02:22:50 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: version.h,v 1.23 2000/11/24 13:01:25 itojun Exp $      */
+/*     $NetBSD: version.h,v 1.24 2000/12/15 02:22:51 lukem Exp $       */
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -40,5 +40,5 @@
 #endif
 
 #ifndef FTP_VERSION
-#define        FTP_VERSION     "20001124"
+#define        FTP_VERSION     "20001214"
 #endif



Home | Main Index | Thread Index | Old Index