[BACK]Return to cmds.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ftp

Diff for /src/usr.bin/ftp/cmds.c between version 1.13 and 1.14

version 1.13, 1997/02/03 01:02:32 version 1.14, 1997/02/03 01:05:33
Line 1 
Line 1 
   /*      $OpenBSD$       */
 /*      $NetBSD: cmds.c,v 1.18 1997/02/01 10:44:54 lukem Exp $  */  /*      $NetBSD: cmds.c,v 1.18 1997/02/01 10:44:54 lukem Exp $  */
   
 /*  /*
Line 37 
Line 38 
 #if 0  #if 0
 static char sccsid[] = "@(#)cmds.c      8.6 (Berkeley) 10/9/94";  static char sccsid[] = "@(#)cmds.c      8.6 (Berkeley) 10/9/94";
 #else  #else
 static char rcsid[] = "$NetBSD: cmds.c,v 1.18 1997/02/01 10:44:54 lukem Exp $";  static char rcsid[] = "$OpenBSD$";
 #endif  #endif
 #endif /* not lint */  #endif /* not lint */
   
Line 100 
Line 101 
                         printf("%s%s", sep, p->t_name);                          printf("%s%s", sep, p->t_name);
                         sep = " | ";                          sep = " | ";
                 }                  }
                 printf(" ]\n");                  puts(" ]");
                 code = -1;                  code = -1;
                 return;                  return;
         }          }
Line 122 
Line 123 
         else          else
                 comret = command("TYPE %s", p->t_mode);                  comret = command("TYPE %s", p->t_mode);
         if (comret == COMPLETE) {          if (comret == COMPLETE) {
                 (void) strcpy(typename, p->t_name);                  (void)strcpy(typename, p->t_name);
                 curtype = type = p->t_type;                  curtype = type = p->t_type;
         }          }
 }  }
Line 321 
Line 322 
         mname = argv[0];          mname = argv[0];
         mflag = 1;          mflag = 1;
         oldintr = signal(SIGINT, mabort);          oldintr = signal(SIGINT, mabort);
         (void) setjmp(jabort);          (void)setjmp(jabort);
         if (proxy) {          if (proxy) {
                 char *cp, *tp2, tmpbuf[MAXPATHLEN];                  char *cp, *tp2, tmpbuf[MAXPATHLEN];
   
Line 367 
Line 368 
                                 }                                  }
                         }                          }
                 }                  }
                 (void) signal(SIGINT, oldintr);                  (void)signal(SIGINT, oldintr);
                 mflag = 0;                  mflag = 0;
                 return;                  return;
         }          }
Line 419 
Line 420 
                 }                  }
                 globfree(&gl);                  globfree(&gl);
         }          }
         (void) signal(SIGINT, oldintr);          (void)signal(SIGINT, oldintr);
         mflag = 0;          mflag = 0;
 }  }
   
Line 429 
Line 430 
         char *argv[];          char *argv[];
 {  {
   
         (void) getit(argc, argv, 1, "r+w");          (void)getit(argc, argv, 1, "r+w");
 }  }
   
 void  void
Line 438 
Line 439 
         char *argv[];          char *argv[];
 {  {
   
         (void) getit(argc, argv, 0, restart_point ? "r+w" : "w" );          (void)getit(argc, argv, 0, restart_point ? "r+w" : "w" );
 }  }
   
 /*  /*
Line 534 
Line 535 
         int ointer, oconf;          int ointer, oconf;
   
         alarmtimer(0);          alarmtimer(0);
         printf("\n");          putchar('\n');
         (void) fflush(stdout);          (void)fflush(stdout);
         if (mflag && fromatty) {          if (mflag && fromatty) {
                 ointer = interactive;                  ointer = interactive;
                 oconf = confirmrest;                  oconf = confirmrest;
Line 573 
Line 574 
         mname = argv[0];          mname = argv[0];
         mflag = 1;          mflag = 1;
         oldintr = signal(SIGINT, mabort);          oldintr = signal(SIGINT, mabort);
         (void) setjmp(jabort);          (void)setjmp(jabort);
         while ((cp = remglob(argv, proxy)) != NULL) {          while ((cp = remglob(argv, proxy)) != NULL) {
                 if (*cp == '\0') {                  if (*cp == '\0') {
                         mflag = 0;                          mflag = 0;
Line 605 
Line 606 
                         }                          }
                 }                  }
         }          }
         (void) signal(SIGINT, oldintr);          (void)signal(SIGINT, oldintr);
         mflag = 0;          mflag = 0;
 }  }
   
Line 631 
Line 632 
         if (connected)          if (connected)
                 printf("Connected to %s.\n", hostname);                  printf("Connected to %s.\n", hostname);
         else          else
                 printf("Not connected.\n");                  puts("Not connected.");
         if (!proxy) {          if (!proxy) {
                 pswitch(1);                  pswitch(1);
                 if (connected) {                  if (connected) {
Line 639 
Line 640 
                             hostname);                              hostname);
                 }                  }
                 else {                  else {
                         printf("No proxy connection.\n");                          puts("No proxy connection.");
                 }                  }
                 pswitch(0);                  pswitch(0);
         }          }
Line 657 
Line 658 
                 printf("Ntrans: (in) %s (out) %s\n", ntin, ntout);                  printf("Ntrans: (in) %s (out) %s\n", ntin, ntout);
         }          }
         else {          else {
                 printf("Ntrans: off\n");                  puts("Ntrans: off");
         }          }
         if (mapflag) {          if (mapflag) {
                 printf("Nmap: (in) %s (out) %s\n", mapin, mapout);                  printf("Nmap: (in) %s (out) %s\n", mapin, mapout);
         }          }
         else {          else {
                 printf("Nmap: off\n");                  puts("Nmap: off");
         }          }
         printf("Hash mark printing: %s; Mark count: %d; Progress bar: %s\n",          printf("Hash mark printing: %s; Mark count: %d; Progress bar: %s\n",
             onoff(hash), mark, onoff(progress));              onoff(hash), mark, onoff(progress));
Line 672 
Line 673 
         printf("Command line editing: %s\n", onoff(editing));          printf("Command line editing: %s\n", onoff(editing));
 #endif /* !SMALLFTP */  #endif /* !SMALLFTP */
         if (macnum > 0) {          if (macnum > 0) {
                 printf("Macros:\n");                  puts("Macros:");
                 for (i=0; i<macnum; i++) {                  for (i=0; i<macnum; i++) {
                         printf("\t%s\n", macros[i].mac_name);                          printf("\t%s\n", macros[i].mac_name);
                 }                  }
Line 701 
Line 702 
                 return -1;                  return -1;
         }          }
         printf("%s %s.\n", mesg, onoff(*var));          printf("%s %s.\n", mesg, onoff(*var));
         return *var;          return (*var);
 }  }
   
 /*  /*
Line 777 
Line 778 
         printf("Hash mark printing %s", onoff(hash));          printf("Hash mark printing %s", onoff(hash));
         if (hash)          if (hash)
                 printf(" (%d bytes/hash mark)", mark);                  printf(" (%d bytes/hash mark)", mark);
         printf(".\n");          puts(".");
         code = hash;          code = hash;
 }  }
   
Line 921 
Line 922 
         r = command("CWD %s", argv[1]);          r = command("CWD %s", argv[1]);
         if (r == ERROR && code == 500) {          if (r == ERROR && code == 500) {
                 if (verbose)                  if (verbose)
                         printf("CWD command not recognized, trying XCWD\n");                          puts("CWD command not recognized, trying XCWD");
                 r = command("XCWD %s", argv[1]);                  r = command("XCWD %s", argv[1]);
         }          }
         if (r == COMPLETE)          if (r == COMPLETE)
Line 976 
Line 977 
                 code = -1;                  code = -1;
                 return;                  return;
         }          }
         (void) command("DELE %s", argv[1]);          (void)command("DELE %s", argv[1]);
 }  }
   
 /*  /*
Line 999 
Line 1000 
         mname = argv[0];          mname = argv[0];
         mflag = 1;          mflag = 1;
         oldintr = signal(SIGINT, mabort);          oldintr = signal(SIGINT, mabort);
         (void) setjmp(jabort);          (void)setjmp(jabort);
         while ((cp = remglob(argv, 0)) != NULL) {          while ((cp = remglob(argv, 0)) != NULL) {
                 if (*cp == '\0') {                  if (*cp == '\0') {
                         mflag = 0;                          mflag = 0;
                         continue;                          continue;
                 }                  }
                 if (mflag && confirm(argv[0], cp)) {                  if (mflag && confirm(argv[0], cp)) {
                         (void) command("DELE %s", cp);                          (void)command("DELE %s", cp);
                         if (!mflag && fromatty) {                          if (!mflag && fromatty) {
                                 ointer = interactive;                                  ointer = interactive;
                                 interactive = 1;                                  interactive = 1;
Line 1017 
Line 1018 
                         }                          }
                 }                  }
         }          }
         (void) signal(SIGINT, oldintr);          (void)signal(SIGINT, oldintr);
         mflag = 0;          mflag = 0;
 }  }
   
Line 1039 
Line 1040 
                 return;                  return;
         }          }
         if (command("RNFR %s", argv[1]) == CONTINUE)          if (command("RNFR %s", argv[1]) == CONTINUE)
                 (void) command("RNTO %s", argv[2]);                  (void)command("RNTO %s", argv[2]);
 }  }
   
 /*  /*
Line 1113 
Line 1114 
         mname = argv[0];          mname = argv[0];
         mflag = 1;          mflag = 1;
         oldintr = signal(SIGINT, mabort);          oldintr = signal(SIGINT, mabort);
         (void) setjmp(jabort);          (void)setjmp(jabort);
         for (i = 1; mflag && i < argc-1; ++i) {          for (i = 1; mflag && i < argc-1; ++i) {
                 *mode = (i == 1) ? 'w' : 'a';                  *mode = (i == 1) ? 'w' : 'a';
                 recvrequest(cmd, dest, argv[i], mode, 0);                  recvrequest(cmd, dest, argv[i], mode, 0);
Line 1126 
Line 1127 
                         interactive = ointer;                          interactive = ointer;
                 }                  }
         }          }
         (void) signal(SIGINT, oldintr);          (void)signal(SIGINT, oldintr);
         mflag = 0;          mflag = 0;
 }  }
   
Line 1148 
Line 1149 
         old2 = signal (SIGQUIT, SIG_IGN);          old2 = signal (SIGQUIT, SIG_IGN);
         if ((pid = fork()) == 0) {          if ((pid = fork()) == 0) {
                 for (pid = 3; pid < 20; pid++)                  for (pid = 3; pid < 20; pid++)
                         (void) close(pid);                          (void)close(pid);
                 (void) signal(SIGINT, SIG_DFL);                  (void)signal(SIGINT, SIG_DFL);
                 (void) signal(SIGQUIT, SIG_DFL);                  (void)signal(SIGQUIT, SIG_DFL);
                 shell = getenv("SHELL");                  shell = getenv("SHELL");
                 if (shell == NULL)                  if (shell == NULL)
                         shell = _PATH_BSHELL;                          shell = _PATH_BSHELL;
Line 1158 
Line 1159 
                 if (namep == NULL)                  if (namep == NULL)
                         namep = shell;                          namep = shell;
                 shellnam[0] = '-';                  shellnam[0] = '-';
                 (void) strncpy(shellnam + 1, ++namep, sizeof(shellnam) - 1);                  (void)strncpy(shellnam + 1, ++namep, sizeof(shellnam) - 2);
                   shellnam[sizeof(shellnam) - 1] = '\0';
                 if (strcmp(namep, "sh") != 0)                  if (strcmp(namep, "sh") != 0)
                         shellnam[0] = '+';                          shellnam[0] = '+';
                 if (debug) {                  if (debug) {
                         printf ("%s\n", shell);                          puts(shell);
                         (void) fflush (stdout);                          (void)fflush(stdout);
                 }                  }
                 if (argc > 1) {                  if (argc > 1) {
                         execl(shell, shellnam, "-c", altarg, (char *)0);                          execl(shell, shellnam, "-c", altarg, (char *)0);
Line 1178 
Line 1180 
         if (pid > 0)          if (pid > 0)
                 while (wait((int *)&status) != pid)                  while (wait((int *)&status) != pid)
                         ;                          ;
         (void) signal(SIGINT, old1);          (void)signal(SIGINT, old1);
         (void) signal(SIGQUIT, old2);          (void)signal(SIGQUIT, old2);
         if (pid == -1) {          if (pid == -1) {
                 warn("%s", "Try again later");                  warn("%s", "Try again later");
                 code = -1;                  code = -1;
Line 1201 
Line 1203 
         int n, aflag = 0;          int n, aflag = 0;
   
         if (argc < 2)          if (argc < 2)
                 (void) another(&argc, &argv, "username");                  (void)another(&argc, &argv, "username");
         if (argc < 2 || argc > 4) {          if (argc < 2 || argc > 4) {
                 printf("usage: %s username [password] [account]\n", argv[0]);                  printf("usage: %s username [password] [account]\n", argv[0]);
                 code = -1;                  code = -1;
Line 1215 
Line 1217 
         }          }
         if (n == CONTINUE) {          if (n == CONTINUE) {
                 if (argc < 4) {                  if (argc < 4) {
                         printf("Account: "); (void) fflush(stdout);                          (void)fputs("Account: ", stdout);
                         (void) fgets(acct, sizeof(acct) - 1, stdin);                          (void)fflush(stdout);
                           (void)fgets(acct, sizeof(acct) - 1, stdin);
                         acct[strlen(acct) - 1] = '\0';                          acct[strlen(acct) - 1] = '\0';
                         argv[3] = acct; argc++;                          argv[3] = acct; argc++;
                 }                  }
Line 1224 
Line 1227 
                 aflag++;                  aflag++;
         }          }
         if (n != COMPLETE) {          if (n != COMPLETE) {
                 fprintf(stdout, "Login failed.\n");                  puts("Login failed.");
                 return;                  return;
         }          }
         if (!aflag && argc == 4) {          if (!aflag && argc == 4) {
                 (void) command("ACCT %s", argv[3]);                  (void)command("ACCT %s", argv[3]);
         }          }
 }  }
   
Line 1248 
Line 1251 
          */           */
         verbose = 1;          verbose = 1;
         if (command("PWD") == ERROR && code == 500) {          if (command("PWD") == ERROR && code == 500) {
                 printf("PWD command not recognized, trying XPWD\n");                  puts("PWD command not recognized, trying XPWD");
                 (void) command("XPWD");                  (void)command("XPWD");
         }          }
         verbose = oldverbose;          verbose = oldverbose;
 }  }
Line 1288 
Line 1291 
         }          }
         if (command("MKD %s", argv[1]) == ERROR && code == 500) {          if (command("MKD %s", argv[1]) == ERROR && code == 500) {
                 if (verbose)                  if (verbose)
                         printf("MKD command not recognized, trying XMKD\n");                          puts("MKD command not recognized, trying XMKD");
                 (void) command("XMKD %s", argv[1]);                  (void)command("XMKD %s", argv[1]);
         }          }
 }  }
   
Line 1310 
Line 1313 
         }          }
         if (command("RMD %s", argv[1]) == ERROR && code == 500) {          if (command("RMD %s", argv[1]) == ERROR && code == 500) {
                 if (verbose)                  if (verbose)
                         printf("RMD command not recognized, trying XRMD\n");                          puts("RMD command not recognized, trying XRMD");
                 (void) command("XRMD %s", argv[1]);                  (void)command("XRMD %s", argv[1]);
         }          }
 }  }
   
Line 1364 
Line 1367 
         int i, len;          int i, len;
         char buf[BUFSIZ];               /* must be >= sizeof(line) */          char buf[BUFSIZ];               /* must be >= sizeof(line) */
   
         (void) strncpy(buf, initial, sizeof(buf));          (void)strncpy(buf, initial, sizeof(buf) - 1);
           buf[sizeof(buf) - 1] = '\0';
         if (argc > 1) {          if (argc > 1) {
                 len = strlen(buf);                  len = strlen(buf);
                 len += strlen(strncpy(&buf[len], argv[1], sizeof(buf) - len));                  len += strlen(strncpy(&buf[len], argv[1], sizeof(buf) - len - 1));
                 for (i = 2; i < argc; i++) {                  for (i = 2; i < argc && len < sizeof(buf); i++) {
                         buf[len++] = ' ';                          buf[len++] = ' ';
                         len += strlen(strncpy(&buf[len], argv[i],                          len += strlen(strncpy(&buf[len], argv[i],
                             sizeof(buf) - len));                              sizeof(buf) - len) - 1);
                 }                  }
         }          }
         if (command(buf) == PRELIM) {          if (command(buf) == PRELIM) {
Line 1394 
Line 1398 
                 code = -1;                  code = -1;
                 return;                  return;
         }          }
         (void) command("SITE CHMOD %s %s", argv[1], argv[2]);          (void)command("SITE CHMOD %s %s", argv[1], argv[2]);
 }  }
   
 void  void
Line 1405 
Line 1409 
         int oldverbose = verbose;          int oldverbose = verbose;
   
         verbose = 1;          verbose = 1;
         (void) command(argc == 1 ? "SITE UMASK" : "SITE UMASK %s", argv[1]);          (void)command(argc == 1 ? "SITE UMASK" : "SITE UMASK %s", argv[1]);
         verbose = oldverbose;          verbose = oldverbose;
 }  }
   
Line 1417 
Line 1421 
         int oldverbose = verbose;          int oldverbose = verbose;
   
         verbose = 1;          verbose = 1;
         (void) command(argc == 1 ? "SITE IDLE" : "SITE IDLE %s", argv[1]);          (void)command(argc == 1 ? "SITE IDLE" : "SITE IDLE %s", argv[1]);
         verbose = oldverbose;          verbose = oldverbose;
 }  }
   
Line 1432 
Line 1436 
         int oldverbose = verbose;          int oldverbose = verbose;
   
         verbose = 1;          verbose = 1;
         (void) command(argc == 1 ? "HELP" : "HELP %s", argv[1]);          (void)command(argc == 1 ? "HELP" : "HELP %s", argv[1]);
         verbose = oldverbose;          verbose = oldverbose;
 }  }
   
Line 1466 
Line 1470 
   
         if (!connected)          if (!connected)
                 return;                  return;
         (void) command("QUIT");          (void)command("QUIT");
         if (cout) {          if (cout) {
                 (void) fclose(cout);                  (void)fclose(cout);
         }          }
         cout = NULL;          cout = NULL;
         connected = 0;          connected = 0;
Line 1494 
Line 1498 
                 ap = argv[1];                  ap = argv[1];
         else          else
                 ap = getpass("Account:");                  ap = getpass("Account:");
         (void) command("ACCT %s", ap);          (void)command("ACCT %s", ap);
 }  }
   
 jmp_buf abortprox;  jmp_buf abortprox;
Line 1533 
Line 1537 
         }          }
         c = getcmd(argv[1]);          c = getcmd(argv[1]);
         if (c == (struct cmd *) -1) {          if (c == (struct cmd *) -1) {
                 printf("?Ambiguous command\n");                  puts("?Ambiguous command");
                 (void) fflush(stdout);                  (void)fflush(stdout);
                 code = -1;                  code = -1;
                 return;                  return;
         }          }
         if (c == 0) {          if (c == 0) {
                 printf("?Invalid command\n");                  puts("?Invalid command");
                 (void) fflush(stdout);                  (void)fflush(stdout);
                 code = -1;                  code = -1;
                 return;                  return;
         }          }
         if (!c->c_proxy) {          if (!c->c_proxy) {
                 printf("?Invalid proxy command\n");                  puts("?Invalid proxy command");
                 (void) fflush(stdout);                  (void)fflush(stdout);
                 code = -1;                  code = -1;
                 return;                  return;
         }          }
Line 1557 
Line 1561 
         oldintr = signal(SIGINT, proxabort);          oldintr = signal(SIGINT, proxabort);
         pswitch(1);          pswitch(1);
         if (c->c_conn && !connected) {          if (c->c_conn && !connected) {
                 printf("Not connected\n");                  puts("Not connected");
                 (void) fflush(stdout);                  (void)fflush(stdout);
                 pswitch(0);                  pswitch(0);
                 (void) signal(SIGINT, oldintr);                  (void)signal(SIGINT, oldintr);
                 code = -1;                  code = -1;
                 return;                  return;
         }          }
Line 1575 
Line 1579 
                 proxflag = 0;                  proxflag = 0;
         }          }
         pswitch(0);          pswitch(0);
         (void) signal(SIGINT, oldintr);          (void)signal(SIGINT, oldintr);
 }  }
   
 void  void
Line 1603 
Line 1607 
 {  {
         if (argc == 1) {          if (argc == 1) {
                 ntflag = 0;                  ntflag = 0;
                 printf("Ntrans off.\n");                  puts("Ntrans off.");
                 code = ntflag;                  code = ntflag;
                 return;                  return;
         }          }
         ntflag++;          ntflag++;
         code = ntflag;          code = ntflag;
         (void) strncpy(ntin, argv[1], 16);          (void)strncpy(ntin, argv[1], sizeof(ntin) - 1);
         ntin[16] = '\0';          ntin[sizeof(ntin) - 1] = '\0';
         if (argc == 2) {          if (argc == 2) {
                 ntout[0] = '\0';                  ntout[0] = '\0';
                 return;                  return;
         }          }
         (void) strncpy(ntout, argv[2], 16);          (void)strncpy(ntout, argv[2], sizeof(ntout) - 1);
         ntout[16] = '\0';          ntout[sizeof(ntout) - 1] = '\0';
 }  }
   
 char *  char *
Line 1657 
Line 1661 
   
         if (argc == 1) {          if (argc == 1) {
                 mapflag = 0;                  mapflag = 0;
                 printf("Nmap off.\n");                  puts("Nmap off.");
                 code = mapflag;                  code = mapflag;
                 return;                  return;
         }          }
Line 1676 
Line 1680 
                 cp = strchr(altarg, ' ');                  cp = strchr(altarg, ' ');
         }          }
         *cp = '\0';          *cp = '\0';
         (void) strncpy(mapin, altarg, MAXPATHLEN - 1);          (void)strncpy(mapin, altarg, MAXPATHLEN - 1);
         while (*++cp == ' ')          while (*++cp == ' ')
                 continue;                  continue;
         (void) strncpy(mapout, cp, MAXPATHLEN - 1);          (void)strncpy(mapout, cp, MAXPATHLEN - 1);
 }  }
   
 char *  char *
Line 1792 
Line 1796 
                                                 }                                                  }
                                         }                                          }
                                         if (!*cp2) {                                          if (!*cp2) {
                                                 printf("nmap: unbalanced "                                                  puts("nmap: unbalanced brackets");
                                                         "brackets\n");  
                                                 return (name);                                                  return (name);
                                         }                                          }
                                         match = 1;                                          match = 1;
Line 1806 
Line 1809 
                                               }                                                }
                                         }                                          }
                                         if (!*cp2) {                                          if (!*cp2) {
                                                 printf("nmap: unbalanced "                                                  puts("nmap: unbalanced brackets");
                                                         "brackets\n");  
                                                 return (name);                                                  return (name);
                                         }                                          }
                                         break;                                          break;
Line 1892 
Line 1894 
         r = command("CDUP");          r = command("CDUP");
         if (r == ERROR && code == 500) {          if (r == ERROR && code == 500) {
                 if (verbose)                  if (verbose)
                         printf("CDUP command not recognized, trying XCUP\n");                          puts("CDUP command not recognized, trying XCUP");
                 r = command("XCUP");                  r = command("XCUP");
         }          }
         if (r == COMPLETE)          if (r == COMPLETE)
Line 1907 
Line 1909 
 {  {
   
         if (argc != 2)          if (argc != 2)
                 printf("restart: offset not specified\n");                  puts("restart: offset not specified");
         else {          else {
                 restart_point = atol(argv[1]);                  restart_point = atol(argv[1]);
                 printf("Restarting at %qd. Execute get, put or append to"                  printf("Restarting at %qd. Execute get, put or append to"
Line 1922 
Line 1924 
         char *argv[];          char *argv[];
 {  {
   
         (void) command("SYST");          (void)command("SYST");
 }  }
   
 void  void
Line 1934 
Line 1936 
         int c;          int c;
   
         if (macnum == 16) {          if (macnum == 16) {
                 printf("Limit of 16 macros have already been defined\n");                  puts("Limit of 16 macros have already been defined");
                 code = -1;                  code = -1;
                 return;                  return;
         }          }
Line 1944 
Line 1946 
                 return;                  return;
         }          }
         if (interactive) {          if (interactive) {
                 printf("Enter macro line by line, terminating it with a "                  puts("Enter macro line by line, terminating it with a null line");
                         "null line\n");  
         }          }
         (void) strncpy(macros[macnum].mac_name, argv[1], 8);          (void)strncpy(macros[macnum].mac_name, argv[1],
         if (macnum == 0) {              sizeof(macros[macnum].mac_name) - 1);
           macros[macnum].mac_name[sizeof(macros[macnum].mac_name) - 1] = '\0';
           if (macnum == 0)
                 macros[macnum].mac_start = macbuf;                  macros[macnum].mac_start = macbuf;
         }          else
         else {  
                 macros[macnum].mac_start = macros[macnum - 1].mac_end + 1;                  macros[macnum].mac_start = macros[macnum - 1].mac_end + 1;
         }  
         tmp = macros[macnum].mac_start;          tmp = macros[macnum].mac_start;
         while (tmp != macbuf+4096) {          while (tmp != macbuf+4096) {
                 if ((c = getchar()) == EOF) {                  if ((c = getchar()) == EOF) {
                         printf("macdef:end of file encountered\n");                          puts("macdef: end of file encountered");
                         code = -1;                          code = -1;
                         return;                          return;
                 }                  }
Line 1980 
Line 1981 
                 while ((c = getchar()) != '\n' && c != EOF)                  while ((c = getchar()) != '\n' && c != EOF)
                         /* LOOP */;                          /* LOOP */;
                 if (c == EOF || getchar() == '\n') {                  if (c == EOF || getchar() == '\n') {
                         printf("Macro not defined - 4k buffer exceeded\n");                          puts("Macro not defined - 4k buffer exceeded");
                         code = -1;                          code = -1;
                         return;                          return;
                 }                  }
Line 2038 
Line 2039 
         char *argv[];          char *argv[];
 {  {
   
         (void) command(argc > 1 ? "STAT %s" : "STAT" , argv[1]);          (void)command(argc > 1 ? "STAT %s" : "STAT" , argv[1]);
 }  }
   
 /*  /*

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14