Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/ftp Change `ls' to use the `LIST' and not `NLST' FTP...



details:   https://anonhg.NetBSD.org/src/rev/3a3814d5f304
branches:  trunk
changeset: 486758:3a3814d5f304
user:      lukem <lukem%NetBSD.org@localhost>
date:      Sun May 28 07:53:30 2000 +0000

description:
Change `ls' to use the `LIST' and not `NLST' FTP protocol command.
Now that after many years on not caring we find certain popular
ftp servers are starting to obey RFC959 to the letter of the law
and will only return a list of filenames (not directories or
other filetypes) in the output of `NLST', then `LIST' is more useful
in this case. (Note that the aforementioned pedanticness means that
filename completion isn't as useful as it could be...)
Fixes [bin/8937] by David A. Gatwood <dgatwood%deepspace.mklinux.org@localhost>

diffstat:

 usr.bin/ftp/cmds.c    |  10 +++++-----
 usr.bin/ftp/ftp.1     |  28 ++++++----------------------
 usr.bin/ftp/version.h |   4 ++--
 3 files changed, 13 insertions(+), 29 deletions(-)

diffs (116 lines):

diff -r 70152635a440 -r 3a3814d5f304 usr.bin/ftp/cmds.c
--- a/usr.bin/ftp/cmds.c        Sun May 28 07:18:58 2000 +0000
+++ b/usr.bin/ftp/cmds.c        Sun May 28 07:53:30 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cmds.c,v 1.85 2000/05/01 10:35:16 lukem Exp $  */
+/*     $NetBSD: cmds.c,v 1.86 2000/05/28 07:53:30 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.85 2000/05/01 10:35:16 lukem Exp $");
+__RCSID("$NetBSD: cmds.c,v 1.86 2000/05/28 07:53:30 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -1255,9 +1255,9 @@
        if (argc == 0 && argv != NULL)
                goto usage;
 
-       cmd = "NLST";
-       if (strcmp(argv[0] + pagecmd, "dir") == 0)
-               cmd = "LIST";
+       cmd = "LIST";
+       if (strcmp(argv[0], "nlist") == 0)
+               cmd = "NLST";
 
        if (argc > 1)
                remdir = argv[1];
diff -r 70152635a440 -r 3a3814d5f304 usr.bin/ftp/ftp.1
--- a/usr.bin/ftp/ftp.1 Sun May 28 07:18:58 2000 +0000
+++ b/usr.bin/ftp/ftp.1 Sun May 28 07:53:30 2000 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: ftp.1,v 1.63 2000/05/01 10:35:18 lukem Exp $
+.\"    $NetBSD: ftp.1,v 1.64 2000/05/28 07:53:30 lukem Exp $
 .\"
 .\" Copyright (c) 1996-2000 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -68,7 +68,7 @@
 .\"
 .\"    @(#)ftp.1       8.3 (Berkeley) 10/9/94
 .\"
-.Dd May 1, 2000
+.Dd May 28, 2000
 .Dt FTP 1
 .Os
 .Sh NAME
@@ -401,8 +401,6 @@
 systems will produce
 output from the command
 .Ql ls \-l .
-(See also
-.Ic ls . )
 If
 .Ar remote-directory
 is left unspecified, the current working directory is used.
@@ -574,22 +572,8 @@
 .It Ic lpwd
 Print the working directory on the local machine.
 .It Ic \&ls Op Ar remote-directory Op Ar local-file
-Print a list of the files in a
-directory on the remote machine.
-If
-.Ar remote-directory
-is left unspecified, the current working directory is used.
-If interactive prompting is on,
-.Nm
-will prompt the user to verify that the last argument is indeed the
-target local file for receiving
-.Ic ls
-output.
-If no local file is specified, or if
-.Ar local-file
-is
-.Fl  ,
-the output is sent to the terminal.
+A synonym for
+.Ic dir .
 .It Ic macdef Ar macro-name
 Define a macro.
 Subsequent lines are stored as the macro
@@ -861,14 +845,14 @@
 Perform
 .Ic dir
 .Op Ar remote-directory ,
-and display it with the program specified by the
+and display the result with the program specified by the
 .Ic "set pager"
 option.
 .It Ic pls Op Ar remote-directory
 Perform
 .Ic ls
 .Op Ar remote-directory ,
-and display it with the program specified by the
+and display the result with the program specified by the
 .Ic "set pager"
 option.
 .It Ic preserve
diff -r 70152635a440 -r 3a3814d5f304 usr.bin/ftp/version.h
--- a/usr.bin/ftp/version.h     Sun May 28 07:18:58 2000 +0000
+++ b/usr.bin/ftp/version.h     Sun May 28 07:53:30 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: version.h,v 1.8 2000/05/01 09:44:55 lukem Exp $        */
+/*     $NetBSD: version.h,v 1.9 2000/05/28 07:53:31 lukem Exp $        */
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -40,5 +40,5 @@
 #endif
 
 #ifndef FTP_VERSION
-#define        FTP_VERSION     "20000501"
+#define        FTP_VERSION     "20000528"
 #endif



Home | Main Index | Thread Index | Old Index