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

Diff for /src/usr.bin/ftp/main.c between version 1.37 and 1.38

version 1.37, 1997/12/17 16:03:05 version 1.38, 1998/02/17 23:22:56
Line 77 
Line 77 
         long port;          long port;
         struct passwd *pw = NULL;          struct passwd *pw = NULL;
         char *cp, *ep, homedir[MAXPATHLEN];          char *cp, *ep, homedir[MAXPATHLEN];
           char *outfile = NULL;
         int dumb_terminal = 0;          int dumb_terminal = 0;
         int outfd = -1;  
   
         sp = getservbyname("ftp", "tcp");          sp = getservbyname("ftp", "tcp");
         if (sp == 0)          if (sp == 0)
Line 170 
Line 170 
         if (isatty(fileno(ttyout)) && !dumb_terminal && foregroundproc())          if (isatty(fileno(ttyout)) && !dumb_terminal && foregroundproc())
                 progress = 1;           /* progress bar on if tty is usable */                  progress = 1;           /* progress bar on if tty is usable */
   
         if (!isatty(fileno(ttyout))) {          while ((ch = getopt(argc, argv, "Aadegino:pPr:tvV")) != -1) {
                 outfd = fileno(stdout);  
                 ttyout = stderr;  
         }  
   
         while ((ch = getopt(argc, argv, "AadeginpPr:tvV")) != -1) {  
                 switch (ch) {                  switch (ch) {
                 case 'A':                  case 'A':
                         activefallback = 0;                          activefallback = 0;
Line 209 
Line 204 
                         autologin = 0;                          autologin = 0;
                         break;                          break;
   
                   case 'o':
                           outfile = optarg;
                           if (strcmp(outfile, "-") == 0)
                                   ttyout = stderr;
                           break;
   
                 case 'p':                  case 'p':
                         passivemode = 1;                          passivemode = 1;
                         activefallback = 0;                          activefallback = 0;
Line 277 
Line 278 
         if (argc > 0) {          if (argc > 0) {
                 if (strchr(argv[0], ':') != NULL) {                  if (strchr(argv[0], ':') != NULL) {
                         anonftp = 1;    /* Handle "automatic" transfers. */                          anonftp = 1;    /* Handle "automatic" transfers. */
                         rval = auto_fetch(argc, argv, outfd);                          rval = auto_fetch(argc, argv, outfile);
                         if (rval >= 0)          /* -1 == connected and cd-ed */                          if (rval >= 0)          /* -1 == connected and cd-ed */
                                 exit(rval);                                  exit(rval);
                 } else {                  } else {

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.38