prettyness police
[unix-history] / usr / src / usr.bin / ftp / domacro.c
index e19c5b3..1e37ee2 100644 (file)
@@ -1,43 +1,31 @@
-
 /*
 /*
- * Copyright (c) 1985 Regents of the University of California.
- * All rights reserved.  The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
+ * Copyright (c) 1985, 1993
+ *     The Regents of the University of California.  All rights reserved.
+ *
+ * %sccs.include.redist.c%
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)domacro.c  1.2 (Berkeley) %G%";
-#endif not lint
-
-#include "ftp_var.h"
+static char sccsid[] = "@(#)domacro.c  8.2 (Berkeley) %G%";
+#endif /* not lint */
 
 
+#include <ctype.h>
 #include <signal.h>
 #include <stdio.h>
 #include <signal.h>
 #include <stdio.h>
-#include <errno.h>
-#include <ctype.h>
-#include <sys/ttychars.h>
+#include <strings.h>
 
 
+#include "ftp_var.h"
+
+void
 domacro(argc, argv)
        int argc;
        char *argv[];
 {
 domacro(argc, argv)
        int argc;
        char *argv[];
 {
-       register int i, j;
-       register char *cp1, *cp2;
-       int count = 2, loopflg = 0;
-       char line2[200];
-       extern char **glob(), *globerr;
-       struct cmd *getcmd(), *c;
-       extern struct cmd cmdtab[];
+       int i, j, count = 2, loopflg = 0;
+       char *cp1, *cp2, line2[200];
+       struct cmd *c;
 
 
-       if (argc < 2) {
-               (void) strcat(line, " ");
-               printf("(macro name) ");
-               (void) gets(&line[strlen(line)]);
-               makeargv();
-               argc = margc;
-               argv = margv;
-       }
-       if (argc < 2) {
+       if (argc < 2 && !another(&argc, &argv, "macro name")) {
                printf("Usage: %s macro_name.\n", argv[0]);
                code = -1;
                return;
                printf("Usage: %s macro_name.\n", argv[0]);
                code = -1;
                return;
@@ -117,7 +105,7 @@ TOP:
                        }
                        (*c->c_handler)(margc, margv);
                        if (bell && c->c_bell) {
                        }
                        (*c->c_handler)(margc, margv);
                        if (bell && c->c_bell) {
-                               (void) putchar(CTRL(g));
+                               (void) putchar('\007');
                        }
                        (void) strcpy(line, line2);
                        makeargv();
                        }
                        (void) strcpy(line, line2);
                        makeargv();