install with -s
[unix-history] / usr / src / usr.bin / ftp / cmds.c
index fd0cc04..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.9 (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[];
@@ -703,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")
@@ -926,7 +934,8 @@ rmthelp(argc, argv)
 quit()
 {
 
 quit()
 {
 
-       disconnect();
+       if (connected)
+               disconnect();
        exit(0);
 }
 
        exit(0);
 }