install with -s
[unix-history] / usr / src / usr.bin / ftp / cmds.c
index 095fb88..50cf1dc 100644 (file)
@@ -1,12 +1,17 @@
+/*
+ * Copyright (c) 1983 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ */
+
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)cmds.c     4.8 (Berkeley) %G%";
-#endif
+static char sccsid[] = "@(#)cmds.c     5.1 (Berkeley) %G%";
+#endif not lint
 
 /*
  * FTP User Program -- Command Routines.
  */
 #include <sys/param.h>
 
 /*
  * FTP User Program -- Command Routines.
  */
 #include <sys/param.h>
-#include <sys/stat.h>
 #include <sys/socket.h>
 
 #include <arpa/ftp.h>
 #include <sys/socket.h>
 
 #include <arpa/ftp.h>
@@ -200,6 +205,9 @@ setstruct(argc, argv)
        printf("We only support %s structure, sorry.\n", structname);
 }
 
        printf("We only support %s structure, sorry.\n", structname);
 }
 
+/*
+ * Send a single file.
+ */
 put(argc, argv)
        int argc;
        char *argv[];
 put(argc, argv)
        int argc;
        char *argv[];
@@ -408,8 +416,8 @@ status(argc, argv)
        printf("Verbose: %s; Bell: %s; Prompting: %s; Globbing: %s\n", 
                onoff(verbose), onoff(bell), onoff(interactive),
                onoff(doglob));
        printf("Verbose: %s; Bell: %s; Prompting: %s; Globbing: %s\n", 
                onoff(verbose), onoff(bell), onoff(interactive),
                onoff(doglob));
-       printf("Hash mark printing: %s; Use of PORT cmds: %s; Linger: %s\n",
-               onoff(hash), onoff(sendport), onoff(linger));
+       printf("Hash mark printing: %s; Use of PORT cmds: %s\n",
+               onoff(hash), onoff(sendport));
 }
 
 /*
 }
 
 /*
@@ -520,26 +528,6 @@ setdebug(argc, argv)
        printf("Debugging %s (debug=%d).\n", onoff(debug), debug);
 }
 
        printf("Debugging %s (debug=%d).\n", onoff(debug), debug);
 }
 
-/*
- * Set linger on data connections on/off.
- */
-/*VARARGS*/
-setlinger(argc, argv)
-       char *argv[];
-{
-
-       if (argc == 1)
-               linger = !linger;
-       else
-               linger = atoi(argv[1]);
-       if (argc == 1 || linger == 0) {
-               printf("Linger on data connection close %s.\n", onoff(linger));
-               return;
-       }
-       printf("Will linger for %d seconds on close of data connections.\n",
-          linger);
-}
-
 /*
  * Set current working directory
  * on remote machine.
 /*
  * Set current working directory
  * on remote machine.
@@ -723,7 +711,7 @@ mls(argc, argv)
        dest = argv[argc - 1];
        argv[argc - 1] = NULL;
        if (strcmp(dest, "-"))
        dest = argv[argc - 1];
        argv[argc - 1] = NULL;
        if (strcmp(dest, "-"))
-               if (globulize(&dest) && confirm("local-file", dest))
+               if (!globulize(&dest) || !confirm("local-file", dest))
                        return;
        cmd = argv[0][1] == 'l' ? "NLST" : "LIST";
        for (mode = "w"; cp = remglob(argc, argv); mode = "a")
                        return;
        cmd = argv[0][1] == 'l' ? "NLST" : "LIST";
        for (mode = "w"; cp = remglob(argc, argv); mode = "a")
@@ -946,7 +934,8 @@ rmthelp(argc, argv)
 quit()
 {
 
 quit()
 {
 
-       disconnect();
+       if (connected)
+               disconnect();
        exit(0);
 }
 
        exit(0);
 }